[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170925154404.GA560070@devbig577.frc2.facebook.com>
Date: Mon, 25 Sep 2017 08:44:04 -0700
From: Tejun Heo <tj@...nel.org>
To: Mark Rutland <mark.rutland@....com>
Cc: linux-kernel@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
Christoph Lameter <cl@...ux.com>,
Peter Zijlstra <peterz@...radead.org>,
Pranith Kumar <bobby.prani@...il.com>,
linux-arch@...r.kernel.org
Subject: Re: [PATCH] percpu: make this_cpu_generic_read() atomic w.r.t.
interrupts
Hello,
On Mon, Sep 25, 2017 at 04:33:02PM +0100, Mark Rutland wrote:
> Unfortunately, the generic this_cpu_read(), which is intended to be
> irq-safe, is not:
>
> #define this_cpu_generic_read(pcp) \
> ({ \
> typeof(pcp) __ret; \
> preempt_disable_notrace(); \
> __ret = raw_cpu_generic_read(pcp); \
> preempt_enable_notrace(); \
> __ret; \
> })
I see. Yeah, that looks like the bug there.
> I guess it'd be preferable to manipulate that in-place.
>
> > Adding READ_ONCE() doesn't generically guarantee that the reads won't
> > be split - e.g. there are arch which simply can't load a 64bit value
> > with a single instruction.
>
> In which case, it really sounds like this_cpu_generic_read() needs to
> disable interrupts too...
Can you please spin up a patch for this?
Thanks.
--
tejun
Powered by blists - more mailing lists