[lkml]   [2013]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] rwsem: reduce spinlock contention in wakeup code path
On Fri, 2013-09-27 at 12:28 -0700, Linus Torvalds wrote:
> On Fri, Sep 27, 2013 at 12:00 PM, Waiman Long <> wrote:
> >
> > On a large NUMA machine, it is entirely possible that a fairly large
> > number of threads are queuing up in the ticket spinlock queue to do
> > the wakeup operation. In fact, only one will be needed. This patch
> > tries to reduce spinlock contention by doing just that.
> >
> > A new wakeup field is added to the rwsem structure. This field is
> > set on entry to rwsem_wake() and __rwsem_do_wake() to mark that a
> > thread is pending to do the wakeup call. It is cleared on exit from
> > those functions.
> Ok, this is *much* simpler than adding the new MCS spinlock, so I'm
> wondering what the performance difference between the two are.

Both approaches should be complementary. The idea of optimistic spinning
in rwsems is to avoid putting putting the writer on the wait queue -
reducing contention and giving a greater chance for the rwsem
to get acquired. Waiman's approach is once the blocking actually occurs,
and at this point I'm not sure how this will affect writer stealing


 \ /
  Last update: 2013-09-27 22:01    [W:0.167 / U:28.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site