lkml.org 
[lkml]   [2011]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 8/5] llist: Remove cpu_relax() usage in cmpxchg loops
    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



    \
     
     \ /
      Last update: 2011-09-13 16:55    [W:2.683 / U:0.312 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site