[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160602160439.GE3190@twins.programming.kicks-ass.net>
Date: Thu, 2 Jun 2016 18:04:39 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Boqun Feng <boqun.feng@...il.com>
Cc: linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
manfred@...orfullife.com, dave@...olabs.net,
paulmck@...ux.vnet.ibm.com, will.deacon@....com,
Waiman.Long@....com, tj@...nel.org, pablo@...filter.org,
kaber@...sh.net, davem@...emloft.net, oleg@...hat.com,
netfilter-devel@...r.kernel.org, sasha.levin@...cle.com,
hofrat@...dl.org, jejb@...isc-linux.org, chris@...kel.net,
rth@...ddle.net, dhowells@...hat.com, schwidefsky@...ibm.com,
mpe@...erman.id.au, ralf@...ux-mips.org, linux@...linux.org.uk,
rkuo@...eaurora.org, vgupta@...opsys.com, james.hogan@...tec.com,
realmz6@...il.com, ysato@...rs.sourceforge.jp, tony.luck@...el.com,
cmetcalf@...lanox.com
Subject: Re: [PATCH -v4 5/7] locking, arch: Update spin_unlock_wait()
On Thu, Jun 02, 2016 at 11:11:07PM +0800, Boqun Feng wrote:
> On Thu, Jun 02, 2016 at 04:44:24PM +0200, Peter Zijlstra wrote:
> > Let me go ponder that some :/
> >
>
> An intial thought of the fix is making queued_spin_unlock_wait() an
> atomic-nop too:
>
> static inline void queued_spin_unlock_wait(struct qspinlock *lock)
> {
> struct __qspinlock *l = (struct __qspinlock *)lock;
>
> while (!cmpxchg(&l->locked, 0, 0))
> cpu_relax();
> }
>
> This could make queued_spin_unlock_wait() a WRITE, with a smp_mb()
> preceding it, it would act like a RELEASE, which can be paired with
> spin_lock().
>
> Just food for thought. ;-)
Not sure that'll actually work. The qspinlock store is completely
unordered and not part of a ll/sc or anything like that.
Doing competing stores might even result in loosing it entirely.
But I think I got something.. Lemme go test it :-)
Powered by blists - more mailing lists