linux/debian/patches-rt/0292-x86-preempt-Check-pree...

38 lines
1.5 KiB
Diff

From 8df0bbe7b80926027d51e888f6490c62864675ad Mon Sep 17 00:00:00 2001
Message-Id: <8df0bbe7b80926027d51e888f6490c62864675ad.1601675153.git.zanussi@kernel.org>
In-Reply-To: <5b5a156f9808b1acf1205606e03da117214549ea.1601675151.git.zanussi@kernel.org>
References: <5b5a156f9808b1acf1205606e03da117214549ea.1601675151.git.zanussi@kernel.org>
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Wed, 14 Aug 2019 17:08:58 +0200
Subject: [PATCH 292/333] x86: preempt: Check preemption level before looking
at lazy-preempt
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.148-rt64.tar.xz
[ Upstream commit 19fc8557f2323c52b26561651ed4d51fc688a740 ]
Before evaluating the lazy-preempt state it must be ensure that the
preempt-count is zero.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
arch/x86/include/asm/preempt.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/include/asm/preempt.h b/arch/x86/include/asm/preempt.h
index f66708779274..afa0e42ccdd1 100644
--- a/arch/x86/include/asm/preempt.h
+++ b/arch/x86/include/asm/preempt.h
@@ -96,6 +96,8 @@ static __always_inline bool __preempt_count_dec_and_test(void)
if (____preempt_count_dec_and_test())
return true;
#ifdef CONFIG_PREEMPT_LAZY
+ if (preempt_count())
+ return false;
if (current_thread_info()->preempt_lazy_count)
return false;
return test_thread_flag(TIF_NEED_RESCHED_LAZY);
--
2.17.1