lkml.org 
[lkml]   [2010]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 00/20] x86: ticket lock rewrite and paravirtualization
    From
    Date
    On Mon, 2010-11-15 at 12:03 -0800, H. Peter Anvin wrote:
    > On 11/15/2010 12:00 PM, Jeremy Fitzhardinge wrote:
    > >
    > > Another approach I discussed with PeterZ and Mathieu is to steal the LSB
    > > of the ticket counters (halving the max CPU count) to use as a "there is
    > > someone in slowpath waiting on this lock". But I haven't spent the time
    > > to work out an algorithm to maintain that flag (or flags, since there
    > > are bits available) in a correct and efficient way.
    > >
    >
    > Definitely worth pondering.

    Right, so the idea was to make the ticket increment 2, which would leave
    the LSB of both the head and tail available. I think that if one were to
    set both (using a cmpxchg), the ticket fast-path wouldn't need any
    changes since head==tail is still the correct condition for acquisition.

    Then the unlock needs an added conditional:
    if (tail & 1)
    unlock_slowpath()



    \
     
     \ /
      Last update: 2010-11-15 21:17    [W:4.227 / U:0.080 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site