All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: "Dexuan Cui" <decui@microsoft.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 08:38:35 +0100	[thread overview]
Message-ID: <53FDA71B020000780002DF2E@mail.emea.novell.com> (raw)
In-Reply-To: <EE124450C0AAF944A40DD71E61F878C99639F3@SINEX14MBXC419.southpacific.corp.microsoft.com>

>>> 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


  parent reply	other threads:[~2014-08-27  7:38 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 [this message]
2014-08-27  7:50   ` Dexuan Cui
2014-08-27  7:58     ` Jürgen Groß
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=53FDA71B020000780002DF2E@mail.emea.novell.com \
    --to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.