[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161017093242.GN3117@twins.programming.kicks-ass.net>
Date: Mon, 17 Oct 2016 11:32:42 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Will Deacon <will.deacon@....com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Waiman Long <waiman.long@....com>,
Jason Low <jason.low2@....com>,
Ding Tianhong <dingtianhong@...wei.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Imre Deak <imre.deak@...el.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Davidlohr Bueso <dave@...olabs.net>,
Tim Chen <tim.c.chen@...ux.intel.com>,
Terry Rudd <terry.rudd@....com>,
"Paul E. McKenney" <paulmck@...ibm.com>,
Jason Low <jason.low2@...com>,
Chris Wilson <chris@...is-wilson.co.uk>,
Daniel Vetter <daniel.vetter@...ll.ch>
Subject: Re: [PATCH -v4 8/8] locking/mutex: Enable optimistic spinning of
woken waiter
On Thu, Oct 13, 2016 at 04:28:01PM +0100, Will Deacon wrote:
> On Fri, Oct 07, 2016 at 04:52:51PM +0200, Peter Zijlstra wrote:
> > @@ -457,15 +472,20 @@ static bool mutex_optimistic_spin(struct
> > * release the lock or go to sleep.
> > */
> > owner = __mutex_owner(lock);
> > - if (owner && !mutex_spin_on_owner(lock, owner))
> > - break;
> > + if (owner) {
> > + if (waiter && owner == task) {
> > + smp_mb(); /* ACQUIRE */
>
> Hmm, is this barrier actually needed? This only happens on the handoff path,
> and we take the wait_lock immediately after this succeeds anyway. That
> control dependency, coupled with the acquire semantics of the spin_lock,
> should be sufficient, no?
Yes, I think you're right. But like said in that earlier email, I'd like
to keep this for now.
Once this code has settled we can reconsider this.
Powered by blists - more mailing lists