public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC 0/3] mutex: Reduce spinning contention when there is no lock owner
@ 2014-01-15  0:33 Jason Low
  2014-01-15  0:33 ` [RFC 1/3] mutex: In mutex_can_spin_on_owner(), return false if task need_resched() Jason Low
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Jason Low @ 2014-01-15  0:33 UTC (permalink / raw)
  To: mingo, peterz, paulmck, Waiman.Long, torvalds, tglx, jason.low2
  Cc: linux-kernel, riel, akpm, davidlohr, hpa, aswin, scott.norton

While optimistic spinning is beneficial to performance, I have found that
threads can potentially spin for a long time while there is no lock owner
during high contention cases. In these scenarios, too much spinning can reduce
performance. This RFC patchset attempts to address some of the issues with
spinning too much with no owner.

Patch 1 changes the mutex_can_spin_on_owner() function to address the
need_resched() case. Patch 2 modifies the way mutex spinners are queued to
reduce mspin_lock and mspin_unlock overhead when there is no owner, and is also
necessary patch for patch 3. Patch 3 limits the number of times each thread
can spin on lock->count when there is no lock owner.

This change benefit the AIM7 fserver (run on disk) at 1000-2000 users
on an 8 socket (80 core) box, with a +19.5% gain with 3.13-rc7 + patchset
compared to the baseline 3.13-rc7 kernel. At 100-900 users, the
% gain was about 4.9%, and there wasn't much performance difference
at 10-90 users. On a 2 socket (8 core) box, there was about a 5.5%
improvement at 1000-2000 users.


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2014-01-16 20:48 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-15  0:33 [RFC 0/3] mutex: Reduce spinning contention when there is no lock owner Jason Low
2014-01-15  0:33 ` [RFC 1/3] mutex: In mutex_can_spin_on_owner(), return false if task need_resched() Jason Low
2014-01-15  7:44   ` Peter Zijlstra
2014-01-15  7:48     ` Peter Zijlstra
2014-01-15 20:37       ` Paul E. McKenney
2014-01-15  0:33 ` [RFC 2/3] mutex: Modify the way optimistic spinners are queued Jason Low
2014-01-15 15:10   ` Waiman Long
2014-01-15 19:23     ` Jason Low
2014-01-15  0:33 ` [RFC 3/3] mutex: When there is no owner, stop spinning after too many tries Jason Low
2014-01-15  1:00   ` Andrew Morton
2014-01-15  7:04     ` Jason Low
2014-01-15  1:06   ` Davidlohr Bueso
2014-01-15  7:34     ` Jason Low
2014-01-15 15:19   ` Waiman Long
2014-01-16  2:45   ` Jason Low
2014-01-16  3:14     ` Linus Torvalds
2014-01-16  6:46       ` Jason Low
2014-01-16 12:05         ` Peter Zijlstra
2014-01-16 20:48           ` Jason Low

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox