From: Avi Kivity <avi@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Huang Ying <ying.huang@intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, Andi Kleen <andi@firstfloor.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: Re: [PATCH 8/5] llist: Remove cpu_relax() usage in cmpxchg loops
Date: Tue, 13 Sep 2011 17:51:58 +0300 [thread overview]
Message-ID: <4E6F6E0E.6070202@redhat.com> (raw)
In-Reply-To: <1315923724.5977.15.camel@twins>
On 09/13/2011 05:22 PM, Peter Zijlstra wrote:
> On Tue, 2011-09-13 at 14:43 +0300, Avi Kivity wrote:
>
> > Another issue is that hypervisors use PAUSE to detect a spinning guest
> > and issue a directed yield to another vcpu. But for cmpxchg loops, the
> > "spinner" would just commit on the next loop, no? So I think there's no
> > objection from that front.
>
> Right, we shouldn't ever spend a significant amount spinning on a
> cmpxchg. If we do we need to fix that instead.
I hate arguing while agreeing, but the issue isn't that we don't spend a
significant time spinning, but that there is no owner. Should the other
cpu go away, we just pick up a new copy of oldval and complete the
transaction.
With spinlocks, even if you hold it for just a single guest cycle, the
situation is different. If the vcpu that holds the spinlock is
preempted, the spinner is forced to spin until the owner is rescheduled.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2011-09-13 14:52 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-08 6:00 [PATCH -mm -v2 0/5] irq_work, Use llist in irq_work Huang Ying
2011-09-08 6:00 ` [PATCH -mm -v2 1/5] llist, Make all llist functions inline Huang Ying
2011-09-08 6:00 ` [PATCH -mm -v2 2/5] llist, Define macro to check NMI safe cmpxchg Huang Ying
2011-09-08 6:00 ` [PATCH -mm -v2 3/5] llist, Move cpu_relax after cmpxchg Huang Ying
2011-09-08 6:00 ` [PATCH -mm -v2 4/5] llist, Return whether list is empty before adding in llist_add Huang Ying
2011-09-08 6:00 ` [PATCH -mm -v2 5/5] irq_work, Use llist in irq_work Huang Ying
2011-09-12 14:05 ` [PATCH 6/5] llist: Add llist_next() Peter Zijlstra
2011-09-12 14:05 ` [PATCH 7/5] sched: Convert to use llist Peter Zijlstra
2011-09-12 14:05 ` [PATCH 8/5] llist: Remove cpu_relax() usage in cmpxchg loops Peter Zijlstra
2011-09-12 14:23 ` Andi Kleen
2011-09-12 14:23 ` Peter Zijlstra
2011-09-12 14:47 ` Mathieu Desnoyers
2011-09-12 15:09 ` Peter Zijlstra
2011-09-12 15:24 ` Peter Zijlstra
2011-09-12 16:38 ` Andi Kleen
2011-09-12 18:53 ` Peter Zijlstra
2011-09-12 14:26 ` Avi Kivity
2011-09-12 14:32 ` Peter Zijlstra
2011-09-13 11:43 ` Avi Kivity
2011-09-13 14:22 ` Peter Zijlstra
2011-09-13 14:51 ` Avi Kivity [this message]
2011-09-13 14:53 ` Peter Zijlstra
2011-09-12 14:06 ` [PATCH -mm -v2 0/5] irq_work, Use llist in irq_work Peter Zijlstra
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=4E6F6E0E.6070202@redhat.com \
--to=avi@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=peterz@infradead.org \
--cc=ying.huang@intel.com \
--subject='Re: [PATCH 8/5] llist: Remove cpu_relax() usage in cmpxchg loops' \
/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
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.