2020-08-28 04:53:35 +00:00
|
|
|
From a3e7fef6c2dbb2a0819df49bf67439311afc5316 Mon Sep 17 00:00:00 2001
|
|
|
|
Message-Id: <a3e7fef6c2dbb2a0819df49bf67439311afc5316.1596234184.git.zanussi@kernel.org>
|
|
|
|
In-Reply-To: <378ee68279f6a7631221f2670a9298620148690d.1596234183.git.zanussi@kernel.org>
|
|
|
|
References: <378ee68279f6a7631221f2670a9298620148690d.1596234183.git.zanussi@kernel.org>
|
2020-02-21 18:07:43 +00:00
|
|
|
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
|
|
Date: Wed, 14 Aug 2019 17:08:58 +0200
|
2020-07-15 20:05:29 +00:00
|
|
|
Subject: [PATCH 292/329] x86: preempt: Check preemption level before looking
|
2020-02-21 18:07:43 +00:00
|
|
|
at lazy-preempt
|
2020-08-28 04:53:35 +00:00
|
|
|
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.135-rt60.tar.xz
|
2020-02-21 18:07:43 +00:00
|
|
|
|
|
|
|
[ 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);
|
|
|
|
--
|
2020-06-22 13:14:16 +00:00
|
|
|
2.17.1
|
2020-02-21 18:07:43 +00:00
|
|
|
|