Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1412290

Re: [RFC][PATCH] mutex: Optimize mutex_trylock() fast-path

From Davidlohr Bueso <dave@stgolabs.net>
Newsgroups linux.kernel
Subject Re: [RFC][PATCH] mutex: Optimize mutex_trylock() fast-path
Date 2016-06-02 16:30 +0200
Message-ID <rFBNg-71V-35@gated-at.bofh.it> (permalink)
References <rFjwZ-3Ju-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 01 Jun 2016, Peter Zijlstra wrote:

>
>A while back Viro posted a number of 'interesting' mutex_is_locked()
>users on IRC, one of those was RCU.
>
>RCU seems to use mutex_is_locked() to avoid doing mutex_trylock(), the
>regular load before modify pattern.
>
>While the use isn't wrong per se, its curious in that its needed at all,
>mutex_trylock() should be good enough on its own to avoid the pointless
>cacheline bounces.

Yeah, and we use ccas just about everywhere else for mutexes.

>
>So fix those and remove the mutex_is_locked() (ab)use from RCU.
>
>Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
>Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>

Acked-by: Davidlohr Bueso <dave@stgolabs.net>

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC][PATCH] mutex: Optimize mutex_trylock() fast-path Peter Zijlstra <peterz@infradead.org> - 2016-06-01 21:00 +0200
  Re: [RFC][PATCH] mutex: Optimize mutex_trylock() fast-path Davidlohr Bueso <dave@stgolabs.net> - 2016-06-02 16:30 +0200
  Re: [RFC][PATCH] mutex: Optimize mutex_trylock() fast-path "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-06-02 17:10 +0200
  [tip:locking/core] locking/mutex: Optimize mutex_trylock()  fast-path tip-bot for Peter Zijlstra <tipbot@zytor.com> - 2016-06-08 16:30 +0200

csiph-web