diff options
author | Will Deacon <will.deacon@arm.com> | 2018-09-20 12:26:40 +0300 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2018-12-07 15:35:53 +0300 |
commit | 396244692232fcf0881cb6ba2404be2906f47681 (patch) | |
tree | 154bdebdb94f8ec79c1b19a8273ca9e0809036f5 /arch/arm64/include/asm/thread_info.h | |
parent | 08861d33d680838753f1f9d3ba9480d3651b764d (diff) | |
download | linux-396244692232fcf0881cb6ba2404be2906f47681.tar.xz |
arm64: preempt: Provide our own implementation of asm/preempt.h
The asm-generic/preempt.h implementation doesn't make use of the
PREEMPT_NEED_RESCHED flag, since this can interact badly with load/store
architectures which rely on the preempt_count word being unchanged across
an interrupt.
However, since we're a 64-bit architecture and the preempt count is
only 32 bits wide, we can simply pack it next to the resched flag and
load the whole thing in one go, so that a dec-and-test operation doesn't
need to load twice.
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/thread_info.h')
-rw-r--r-- | arch/arm64/include/asm/thread_info.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h index cb2c10a8f0a8..bbca68b54732 100644 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h @@ -42,7 +42,18 @@ struct thread_info { #ifdef CONFIG_ARM64_SW_TTBR0_PAN u64 ttbr0; /* saved TTBR0_EL1 */ #endif - int preempt_count; /* 0 => preemptable, <0 => bug */ + union { + u64 preempt_count; /* 0 => preemptible, <0 => bug */ + struct { +#ifdef CONFIG_CPU_BIG_ENDIAN + u32 need_resched; + u32 count; +#else + u32 count; + u32 need_resched; +#endif + } preempt; + }; }; #define thread_saved_pc(tsk) \ |