From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: RE: Re: [PATCH] Fix cpu offline bug Date: Tue, 08 Mar 2011 10:14:08 +0000 Message-ID: <4D760F8002000078000351E8@vpn.id2.novell.com> References: <4D75FC5702000078000351B2@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jinsong Liu Cc: "xen-devel@lists.xensource.com" , Keir Fraser , Xin Li , Yunhong Jiang List-Id: xen-devel@lists.xenproject.org >>> On 08.03.11 at 10:47, "Liu, Jinsong" wrote: > Jan, I'm not quite clear your meaning. > Why and where need to insert barrier, or volatile cpu_state? =20 while ( (seen_state =3D cpu_state) !=3D CPU_STATE_DEAD ) { + barrier(); BUG_ON(seen_state !=3D CPU_STATE_DYING); mdelay(100); cpu_relax(); Without this, the compiler is free to eliminate "seen_state" in favor of reading "cpu_state" twice (irrespective of the optimizer very likely trying to do exactly the opposite). Jan