[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] tools/libxc: make volatile keyword for bitmap operations optional


  • To: Olaf Hering <olaf@xxxxxxxxx>
  • From: Keir Fraser <keir.xen@xxxxxxxxx>
  • Date: Mon, 30 Jan 2012 09:30:17 +0000
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 30 Jan 2012 09:31:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AczfMcbiXZPyGNR0602xhO4oFc0QGg==
  • Thread-topic: [Xen-devel] [PATCH] tools/libxc: make volatile keyword for bitmap operations optional

On 30/01/2012 09:10, "Olaf Hering" <olaf@xxxxxxxxx> wrote:

>>> tools/libxc: make volatile keyword for bitmap operations optional
>>> 
>>> Except for xc_save, all bitmaps maintained by xc_bitops.h are used in single
>>> threaded applications. So nothing will change the bitmaps content, adding
>>> volatile adds just unneeded memory reloads.
>> 
>> The bitops aren't threadsafe anyway, as none of them use atomic rmw
>> instructions. I suspect the volatile declarations are completely pointless
>> and can just be removed.
> 
> Will gcc use the right thing if the array is passed to the hyperviso,
> and will it reload everything after the hypercall? If yes, the volatile
> can indeed go.

Of course. Lots of things would fail to work if calls to outside the current
linkage unit didn't flush/invalidate cached shared-data accesses. That's a
fundamental C compiler thing.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.