]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: use preempt_disable_notrace in _percpu_read/write
authorChunyan Zhang <zhang.chunyan@linaro.org>
Thu, 8 Sep 2016 12:46:42 +0000 (20:46 +0800)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 9 Sep 2016 11:34:47 +0000 (12:34 +0100)
commitbfd75121cebb045f3daccf87653f23e9e9e63b90
tree4545db239efeb695ced5c8b1069d82d63d32be39
parente47f8627b7f071ccf73ecec286c445f207991562
arm64: use preempt_disable_notrace in _percpu_read/write

When debug preempt or preempt tracer is enabled, preempt_count_add/sub()
can be traced by function and function graph tracing, and
preempt_disable/enable() would call preempt_count_add/sub(), so in Ftrace
subsystem we should use preempt_disable/enable_notrace instead.

In the commit eeb9a5a34232 ("ftrace: Have set_ftrace_pid use the bitmap
like events do") the function this_cpu_read() was added to
trace_graph_entry(), and if this_cpu_read() calls preempt_disable(), graph
tracer will go into a recursive loop, even if the tracing_on is
disabled.

So this patch change to use preempt_enable/disable_notrace instead in
this_cpu_read().

Since Yonghui Yang helped a lot to find the root cause of this problem,
so also add his SOB.

Signed-off-by: Yonghui Yang <mark.yang@spreadtrum.com>
Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/percpu.h