Re: [WARNING] kernel/rcu/tree.c:1058 rcu_irq_enter+0x15/0x20

From: Peter Zijlstra
Date: Mon Oct 05 2020 - 03:52:16 EST


On Fri, Oct 02, 2020 at 08:13:13PM +0200, Peter Zijlstra wrote:
> > checks within the irq disabling to get rid of the using cpu pointers within
> > preemptable code warnings
>
> Ah, I think I lost a s/__this_cpu_read/raw_cpu_read/ somewhere. The
> thing is, if we're preemptible/migratable it will be 0 on both CPUs and
> it doesn't matter which 0 we read. If it is !0, IRQs will be disabled
> and we can't get migrated.

Aargh, this isn't in fact correct, and that means I have to revert:

fddf9055a60d ("lockdep: Use raw_cpu_*() for per-cpu variables")

The trouble is that on a bunch of architectures we can read the other
CPUs variable from the new CPU, long after the old CPU has continued
executing things.

So this really needs to be this_cpu_read(). Luckily Sven has already
fixed s390, but let me go audit all the other archs.