[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200415114154.GF20730@hirez.programming.kicks-ass.net>
Date: Wed, 15 Apr 2020 13:41:54 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Muchun Song <songmuchun@...edance.com>
Cc: Will Deacon <will@...nel.org>, mingo@...hat.com, mingo@...nel.org,
linux-kernel@...r.kernel.org
Subject: Re: [External] Re: [PATCH] seqlock: Use while instead of if+goto in
__read_seqcount_begin
On Tue, Apr 14, 2020 at 08:01:06PM +0800, Muchun Song wrote:
> On Tue, Apr 14, 2020 at 7:05 PM Peter Zijlstra <peterz@...radead.org> wrote:
> > .... That said,
> > Will, would it make sense to use smp_cond_load_relaxed() here ?
>
> I have a similar idea. Would it make sense to use smp_cond_load_acquire()
> in raw_read_seqcount_begin()?
Not sure; I did consider it, but that rmb it has seems more natural in
the over-all ordering scheme here. I mean:
load seqcount inc seqcount
rmb wmb
// load stuff // modify stuff
rmb wmb
compare seqcount inc seqcount
is nice and symmetric, making that upper left rmb an acquire 'works' but
is just weird IMO. And I suppose you can make the lower right wmb a
store-release, which is somewhat better, but then it gets all weird when
you consider things like barrier and latch.
So best to just leave it as is I think.
Those incs do seem to be really wanting a WRITE_ONCE() though.
Powered by blists - more mailing lists