diff options
author | Zhen Lei <thunder.leizhen@huawei.com> | 2022-08-25 07:31:54 +0100 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2022-08-31 14:50:08 +0100 |
commit | 370d51c84216d1a41f125f0b04614e677ffe54e3 (patch) | |
tree | fa1945f22dc9c5c248c0cb732752eee5f0a90af2 /arch/arm/include/asm/stacktrace.h | |
parent | edd61fc1ca4c969c34b877f4aa9fb169138b80e3 (diff) | |
download | linux-370d51c84216d1a41f125f0b04614e677ffe54e3.tar.gz linux-370d51c84216d1a41f125f0b04614e677ffe54e3.tar.bz2 linux-370d51c84216d1a41f125f0b04614e677ffe54e3.zip |
ARM: 9232/1: Replace this_cpu_* with raw_cpu_* in handle_bad_stack()
The hardware automatically disable the IRQ interrupt before jumping to the
interrupt or exception vector. Therefore, the preempt_disable() operation
in this_cpu_read() after macro expansion is unnecessary. In fact, function
this_cpu_read() may trigger scheduling, see pseudocode below.
Pseudocode of this_cpu_read(xx):
preempt_disable_notrace();
raw_cpu_read(xx);
if (unlikely(__preempt_count_dec_and_test()))
__preempt_schedule_notrace();
Therefore, use raw_cpu_* instead of this_cpu_* to eliminate potential
hazards. At the very least, it reduces a few lines of assembly code.
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'arch/arm/include/asm/stacktrace.h')
0 files changed, 0 insertions, 0 deletions