[PATCH v4 7/8] lockdep: Change hardirq{s_enabled,_context} to per-cpu variables

Peter Zijlstra peterz at infradead.org
Wed Jun 24 22:31:47 AEST 2020


On Wed, Jun 24, 2020 at 12:17:56PM +0200, Marco Elver wrote:
> On Wed, 24 Jun 2020 at 11:01, Peter Zijlstra <peterz at infradead.org> wrote:

> > And I figured a quick way to get rid of that would be something like the
> > below, seeing how volatile gets auto annotated... but that doesn't seem
> > to actually work.
> >
> > What am I missing?
> 
> There's one more in include/linux/rcupdate.h. I suggested this at some point:
> 
>     https://lore.kernel.org/lkml/20200220213317.GA35033@google.com/
> 
> To avoid volatiles as I don't think they are needed here.

Urgghh.. local_t is very expensive for this. The current code is
actually fine, even on load-store architectures. Using local_t will only
result in it being more expensive for no gain.

I'll go put data_race() around it.


More information about the Linuxppc-dev mailing list