Subject: x86/fpu: Do not disable BH on RT From: Thomas Gleixner Date: Mon, 21 Sep 2020 20:15:50 +0200 Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.9/older/patches-5.9.1-rt20.tar.xz Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/fpu/api.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) --- a/arch/x86/include/asm/fpu/api.h +++ b/arch/x86/include/asm/fpu/api.h @@ -33,12 +33,18 @@ extern void fpregs_mark_activate(void); static inline void fpregs_lock(void) { preempt_disable(); - local_bh_disable(); + /* + * On RT disabling preemption is good enough because bottom halfs + * are always running in thread context. + */ + if (!IS_ENABLED(CONFIG_PREEMPT_RT)) + local_bh_disable(); } static inline void fpregs_unlock(void) { - local_bh_enable(); + if (!IS_ENABLED(CONFIG_PREEMPT_RT)) + local_bh_enable(); preempt_enable(); }