From: Avi Kivity <avi@redhat.com>
To: Christoph Lameter <cl@linux.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
"H. Peter Anvin" <hpa@zytor.com>, Rob Landley <rob@landley.net>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
x86@kernel.org, Arnd Bergmann <arnd@arndb.de>,
Andrew Morton <akpm@linux-foundation.org>,
David Howells <dhowells@redhat.com>,
Akinobu Mita <akinobu.mita@gmail.com>,
Alexey Dobriyan <adobriyan@gmail.com>,
Herbert Xu <herbert@gondor.hengli.com.au>,
Stephen Rothwell <sfr@canb.auug.org.au>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arch@vger.kernel.org, Gleb Natapov <gleb@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
kvm@vger.kernel.org, Marcelo Tosatti <mtosatti@redhat.com>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCHv2] bitops: add _local bitops
Date: Sun, 13 May 2012 13:13:21 +0300 [thread overview]
Message-ID: <4FAF8941.2010308@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1205101401010.18664@router.home>
On 05/10/2012 10:04 PM, Christoph Lameter wrote:
> On Wed, 9 May 2012, Michael S. Tsirkin wrote:
>
> > kvm needs to update some hypervisor variables atomically
> > in a sense that the operation can't be interrupted
> > in the middle. However the hypervisor always runs
> > on the same CPU so it does not need any memory
> > barrier or lock prefix.
> >
> > Add _local bitops for this purpose: define them
> > as non-atomics for x86 and (for now) atomics for
> > everyone else.
>
> Have you tried to use the this_cpu_ops for that purpose? They create the
> per cpu atomic instructions that you want without a lock prefix and can
> also relocate the per cpu pointer to the correct processor via a
> segment register prefix.
>
> There are no bit operations provided right now but those can either be
> improvised using this_cpu_cmpxchg or added.
this_cpu_xchg() should be sufficient, since only bit zero has any
meaning in our use case (so xchg with zero is equivalent to
test_and_clear_bit).
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-05-13 10:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-09 16:28 [PATCHv2] bitops: add _local bitops Michael S. Tsirkin
2012-05-10 19:04 ` Christoph Lameter
2012-05-13 10:13 ` Avi Kivity [this message]
2012-05-13 10:45 ` Michael S. Tsirkin
2012-05-13 10:48 ` Avi Kivity
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=4FAF8941.2010308@redhat.com \
--to=avi@redhat.com \
--cc=adobriyan@gmail.com \
--cc=akinobu.mita@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=cl@linux.com \
--cc=dhowells@redhat.com \
--cc=gleb@redhat.com \
--cc=herbert@gondor.hengli.com.au \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=rob@landley.net \
--cc=sfr@canb.auug.org.au \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=x86@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;
as well as URLs for NNTP newsgroup(s).