From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755560AbbI3Lxz (ORCPT ); Wed, 30 Sep 2015 07:53:55 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:54670 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753049AbbI3Lxx (ORCPT ); Wed, 30 Sep 2015 07:53:53 -0400 Date: Wed, 30 Sep 2015 13:53:47 +0200 From: Peter Zijlstra To: =?utf-8?B?5rKz5ZCI6Iux5a6PIC8gS0FXQUnvvIxISURFSElSTw==?= Cc: "kbuild-all@01.org" , Jonathan Corbet , Ingo Molnar , "Eric W. Biederman" , "H. Peter Anvin" , Andrew Morton , Thomas Gleixner , Vivek Goyal , "linux-doc@vger.kernel.org" , "x86@kernel.org" , "kexec@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Michal Hocko , =?utf-8?B?5bmz5p2+6ZuF5bezIC8gSElSQU1BVFXvvIxNQVNBTUk=?= Subject: Re: Re: [V4 PATCH 3/4] kexec: Fix race between panic() and crash_kexec() called directly Message-ID: <20150930115347.GH2881@worktop.programming.kicks-ass.net> References: <20150925112809.4258.39950.stgit@softrs> <201509281128.r1CboaDC%fengguang.wu@intel.com> <04EAB7311EE43145B2D3536183D1A84454994C26@GSjpTKYDCembx31.service.hitachi.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <04EAB7311EE43145B2D3536183D1A84454994C26@GSjpTKYDCembx31.service.hitachi.net> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 28, 2015 at 07:08:19AM +0000, 河合英宏 / KAWAI,HIDEHIRO wrote: > > >> kernel/kexec_core.c:899:3: note: in expansion of macro 'atomic_xchg' > > atomic_xchg(&panic_cpu, -1); > > ^ > > I changed to use atomic_xchg() instead of atomic_set() in V3 > because atomic_set() doesn't mean memory barrier. However, > I thought again and there is no need of barrier; there is no > problem if a competitor sees old value of panic_cpu or new one. > So, atomic_set() is sufficient and using it will remove this warning. > > I will resend the fixed version later. So if you rely on the memory barrier; you should have also put a comment on explaining the ordering requirements.