From: "Jürgen Groß" <jgross@suse.com>
To: Dexuan Cui <decui@microsoft.com>, Jan Beulich <JBeulich@suse.com>
Cc: "jeremy@goop.org" <jeremy@goop.org>,
KY Srinivasan <kys@microsoft.com>,
"chrisw@sous-sol.org" <chrisw@sous-sol.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: sync_set_bit() vs set_bit() -- what's the difference?
Date: Wed, 27 Aug 2014 09:58:50 +0200 [thread overview]
Message-ID: <53FD8FBA.1040203@suse.com> (raw)
In-Reply-To: <EE124450C0AAF944A40DD71E61F878C9963AA0@SINEX14MBXC419.southpacific.corp.microsoft.com>
On 08/27/2014 09:50 AM, Dexuan Cui wrote:
>> -----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. :-)
Even worse: it is patched away dynamically when you disable all but one
processor and activated again when a second processor is becoming
active.
Juergen
next prev parent reply other threads:[~2014-08-27 7:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-27 7:30 sync_set_bit() vs set_bit() -- what's the difference? Dexuan Cui
2014-08-27 7:38 ` Jürgen Groß
2014-08-27 7:38 ` Jan Beulich
2014-08-27 7:50 ` Dexuan Cui
2014-08-27 7:58 ` Jürgen Groß [this message]
2014-08-27 13:56 ` KY Srinivasan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53FD8FBA.1040203@suse.com \
--to=jgross@suse.com \
--cc=JBeulich@suse.com \
--cc=chrisw@sous-sol.org \
--cc=decui@microsoft.com \
--cc=jeremy@goop.org \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox