From: Samuel Thibault Subject: Re: [PATCH] mini-os: fix bit ops comments and memory clobbers. Date: Wed, 18 Jun 2014 11:33:05 +0200 Message-ID: <20140618093305.GE5894@type.bordeaux.inria.fr> References: <20140618082920.GC5894@type.bordeaux.inria.fr> <53A15C1B.8030106@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WxCEu-0003T8-9n for xen-devel@lists.xenproject.org; Wed, 18 Jun 2014 09:33:08 +0000 Content-Disposition: inline In-Reply-To: <53A15C1B.8030106@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org Andrew Cooper, le Wed 18 Jun 2014 10:30:03 +0100, a =E9crit : > On 18/06/14 09:29, Samuel Thibault wrote: > > This fixes comments about test_and_clear_bit, set_bit and clear_bit, > > which are actually not atomic, can be reordered and are not memory > > barriers. > > > > This also drops the empty LOCK and LOCK_PREFIX macros which bring to the > > confusion. > > > > This also adds missing memory clobbers to set_bit and clear_bit. > > > > Signed-off-by: Samuel Thibault > = > Do you mean reordered by the compiler or reordered by the pipeline? Yes. > The memory clobbers prevent the compiler reordering, but lack of > [lsm]fence instructions allow the pipeline to reorder the reads/writes > if it chooses. Ah, actually I was adding the memory clobbers to tell the compiler that we are modifying memory, but here we already properly tell so through "=3Dm". Let me redo the patch without it. Samuel