[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181002134358.GD26858@hirez.programming.kicks-ass.net>
Date: Tue, 2 Oct 2018 15:43:58 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Will Deacon <will.deacon@....com>
Cc: mingo@...nel.org, linux-kernel@...r.kernel.org, longman@...hat.com,
andrea.parri@...rulasolutions.com, tglx@...utronix.de
Subject: Re: [RFC][PATCH 2/3] locking/qspinlock: Rework some comments
On Tue, Oct 02, 2018 at 02:20:05PM +0100, Will Deacon wrote:
> > Ah, so the reason I write it like so is because when we get here,
> > val.locked_pending == 0, per the atomic_cond_read_acquire() condition.
>
> Ah, and I vaguely remember discussing this before. The way I read these
> transition diagrams, I find it most useful if they correspond to the lock
> word in memory. That way, it makes it clear about exactly which fields are
> stable, and which can be concurrently modified. So in the comment above,
> saying:
>
> *,*,0 -> *,*,1 : lock, contended
>
> is really helpful, because it clearly says "we're taking the lock, but the
> rest of the lock word could be modified by others at the same time", whereas
> saying:
>
> *,0,0 -> *,0,1 : lock, contended
>
> implies to me that pending is stable and cannot be set concurrently.
Fair enough, will restore.
Powered by blists - more mailing lists