This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel] Re: [RFC PATCH 05/35] Add sync bitops

* Christoph Lameter (clameter@xxxxxxx) wrote:
> On Tue, 9 May 2006, Chris Wright wrote:
> > Add "always lock'd" implementations of set_bit, clear_bit and
> > change_bit and the corresponding test_and_ functions.  Also add
> > "always lock'd" implementation of cmpxchg.  These give guaranteed
> > strong synchronisation and are required for non-SMP kernels running on
> > an SMP hypervisor.
> Could you explain why this is done and what is exactly meant with "always 
> looked"? Wh the performance impact?

The standard UP bitops are not atomic.  But a UP guest may be on SMP
machine, and the bitmaps here are shared between guests.  The always
locked means the lock prefix is not conditional on either UP build
(or smp alternatives patching), and memory barriers are in place.
There's no performance penalty unless you use them, as it's a new set
(somewhat similar to the bitops changes you were looking into).  Although,
this is the simplest, with no multiplexing, simply new interface, synch_*.
Open to ideas here.  Xen is another possible consumer of your bitops


Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>