[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200916082057.GA27496@willie-the-truck>
Date: Wed, 16 Sep 2020 09:20:58 +0100
From: Will Deacon <will@...nel.org>
To: peterz@...radead.org
Cc: Oleg Nesterov <oleg@...hat.com>, Hou Tao <houtao1@...wei.com>,
Ingo Molnar <mingo@...hat.com>,
Dennis Zhou <dennis@...nel.org>, Tejun Heo <tj@...nel.org>,
Christoph Lameter <cl@...ux.com>, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org, Jan Kara <jack@...e.cz>
Subject: Re: [RFC PATCH] locking/percpu-rwsem: use this_cpu_{inc|dec}() for
read_count
On Tue, Sep 15, 2020 at 08:11:12PM +0200, peterz@...radead.org wrote:
> On Tue, Sep 15, 2020 at 05:11:23PM +0100, Will Deacon wrote:
> > On Tue, Sep 15, 2020 at 06:03:44PM +0200, peterz@...radead.org wrote:
> > > On Tue, Sep 15, 2020 at 05:51:50PM +0200, peterz@...radead.org wrote:
> > >
> > > > Anyway, I'll rewrite the Changelog and stuff it in locking/urgent.
> > >
> > > How's this?
> > >
> > > ---
> > > Subject: locking/percpu-rwsem: Use this_cpu_{inc,dec}() for read_count
> > > From: Hou Tao <houtao1@...wei.com>
> > > Date: Tue, 15 Sep 2020 22:07:50 +0800
> > >
> > > From: Hou Tao <houtao1@...wei.com>
> > >
> > > The __this_cpu*() accessors are (in general) IRQ-unsafe which, given
> > > that percpu-rwsem is a blocking primitive, should be just fine.
> > >
> > > However, file_end_write() is used from IRQ context and will cause
> > > load-store issues.
> >
> > ... on architectures where the per-cpu accessors are not atomic.
>
> That's not entirely accurate, on x86 for example the per-cpu ops are not
> atomic, but they are not susceptible to this problem due to them being a
> single instruction from the point of interrupts -- either they wholly
> happen or they don't.
Hey, the implication is still correct though ;)
> So I'd reformulate it like: "... on architectures where the per-cpu
> accessors are not natively irq-safe" ?
But yeah, that's better. Thanks.
Will
Powered by blists - more mailing lists