lkml.org 
[lkml]   [2014]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH] mutex: Documentation rewrite
From
Date
On Wed, 2014-05-21 at 14:16 -0700, Jason Low wrote:
> On Wed, 2014-05-21 at 10:41 -0700, Davidlohr Bueso wrote:
> > From: Davidlohr Bueso <davidlohr@hp.com>
>
> > + The MCS lock (proposed by Mellor-Crummey and Scott) is a simple spinlock
> > + with the desirable properties of being fair and with each cpu trying
> > + to acquire the lock spinning on a local variable. It avoids expensive
> > + cacheline bouncing that common test-and-set spinlock implementations
> > + incur. An MCS-like lock is specially tailored for optimistic spinning
> > + for sleeping lock implementation.
>
> Would it be helpful to also briefly mention the benefit of using the
> specially tailored MCS lock? Maybe something along the lines of: an
> important feature of the customized MCS lock is that it has the extra
> property that spinners are able to exit the MCS spinlock queue when they
> needs to reschedule. This further helps avoid situations where MCS
> spinners that need to reschedule would continue waiting to spin on mutex
> owner, only to go directly to slowpath upon obtaining the MCS lock.

Good idea, will add it. I didn't want to go into too much details about
MCS locks but it is worth mentioning the cancelable properties we now
have in the kernel.

Thanks,
Davidlohr




\
 
 \ /
  Last update: 2014-05-22 01:21    [W:0.068 / U:1.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site