lkml.org 
[lkml]   [2014]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: sync_set_bit() vs set_bit() -- what's the difference?
Date
> -----Original Message-----
> From: Jan Beulich
> Sent: Wednesday, August 27, 2014 15:39 PM
> >>> On 27.08.14 at 09:30, <decui@microsoft.com> wrote:
> > I'm curious about the difference. :-)
> >
> > sync_set_bit() is only used in drivers/hv/ and drivers/xen/ while set_bit()
> > is used in all other places. What makes hv/xen special?
>
> I guess this would really want to be used by anything communicating
> with a hypervisor or a remote driver: set_bit() gets its LOCK prefix
> discarded when the local kernel determines it runs on a single CPU
> only. Obviously having knowledge of the CPU count inside a VM does
> not imply anything about the number of CPUs available to the host,
> i.e. stripping LOCK prefixes in that case would be unsafe.
>
> Jan

Thank you, Juergen and Jan for your quick answers!

I didn't realize LOCK_PREFIX is "" for UP. :-)

Thanks,
-- Dexuan


\
 
 \ /
  Last update: 2014-08-27 10:01    [W:0.054 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site