]> git.baikalelectronics.ru Git - kernel.git/commit
lockdep: Revert "lockdep: Use raw_cpu_*() for per-cpu variables"
authorPeter Zijlstra <peterz@infradead.org>
Mon, 5 Oct 2020 07:56:57 +0000 (09:56 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 9 Oct 2020 06:54:00 +0000 (08:54 +0200)
commit6a3ad59a3e69efae3eeb6ce1668dd91fd846aecb
tree3e39abc0cc9a2ddee427e03a09d97b8b5bf61828
parentde412324aec7daf76d6c2fea7dd03c38a3405267
lockdep: Revert "lockdep: Use raw_cpu_*() for per-cpu variables"

The thinking in commit:

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

is flawed. While it is true that when we're migratable both CPUs will
have a 0 value, it doesn't hold that when we do get migrated in the
middle of a raw_cpu_op(), the old CPU will still have 0 by the time we
get around to reading it on the new CPU.

Luckily, the reason for that commit (s390 using preempt_disable()
instead of preempt_disable_notrace() in their percpu code), has since
been fixed by commit:

  47713f4234ca ("s390: don't trace preemption in percpu macros")

An audit of arch/*/include/asm/percpu*.h shows there are no other
architectures affected by this particular issue.

Fixes: 6a47c986e3cd ("lockdep: Use raw_cpu_*() for per-cpu variables")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lkml.kernel.org/r/20201005095958.GJ2651@hirez.programming.kicks-ass.net
include/linux/lockdep.h