lkml.org 
[lkml]   [2014]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC][PATCH v2 5/5] mutex: Give spinners a chance to spin_on_owner if need_resched() triggered while queued
    On 02/06/2014 09:04 AM, Peter Zijlstra wrote:
    > On Wed, Feb 05, 2014 at 04:44:34PM -0500, Waiman Long wrote:
    >> I have an alternative way of breaking out of the MCS lock waiting queue when
    >> need_resched() is set. I overload the locked flag to indicate a skipped node
    >> if negative.
    > I'm not quite seeing how it works (then again, I've not really read the
    > patch carefully).
    >
    > Suppose you break out; at that point you get queued and go to sleep.
    > Suppose you got woken up while you MCS entry is still 'pending' and
    > magically win the race and acquire the lock.
    >
    > At that point your MCS entry can be re-used while its still part of the
    > list.

    Actually the MCS node entry cannot be reused until an MCS queue head
    task traverses that entry and clear the locked flag. So it is possible
    that the affected CPU won't be able to participate in optimistic
    spinning for a while if the mutex is heavily contended.

    > Its a fantastically small race window, but I don't see anything that
    > makes it impossible.

    I will send out an official patch with some performance data to solicit
    further feedback.

    >> I run the patch through the AIM7 high-systime workload on a
    >> 4-socket server and it seemed to run fine.
    > How do people run this AIM7 piece of shit? I let it run for over an hour
    > and it generated exactly 0 numbers, it just sits there eating cpu-time
    > and creating a racket from my pantry.

    AIM7 can be tricky to set up. Fortunately, someone in our team had done
    the ground work so I can just grab and run it.

    -Longman


    \
     
     \ /
      Last update: 2014-02-06 20:21    [W:3.349 / U:0.048 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site