37 lines
1.4 KiB
Diff
37 lines
1.4 KiB
Diff
From b1ee2a3de2cff388f708279f7f832ba76782e9ef Mon Sep 17 00:00:00 2001
|
|
Message-Id: <b1ee2a3de2cff388f708279f7f832ba76782e9ef.1596234184.git.zanussi@kernel.org>
|
|
In-Reply-To: <378ee68279f6a7631221f2670a9298620148690d.1596234183.git.zanussi@kernel.org>
|
|
References: <378ee68279f6a7631221f2670a9298620148690d.1596234183.git.zanussi@kernel.org>
|
|
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
Date: Mon, 18 Feb 2019 16:57:09 +0100
|
|
Subject: [PATCH 240/329] x86: lazy-preempt: properly check against
|
|
preempt-mask
|
|
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.135-rt60.tar.xz
|
|
|
|
should_resched() should check against preempt_offset after unmasking the
|
|
need-resched-bit. Otherwise should_resched() won't work for
|
|
preempt_offset != 0 and lazy-preempt set.
|
|
|
|
Cc: stable-rt@vger.kernel.org
|
|
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
---
|
|
arch/x86/include/asm/preempt.h | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/arch/x86/include/asm/preempt.h b/arch/x86/include/asm/preempt.h
|
|
index 22992c837795..f66708779274 100644
|
|
--- a/arch/x86/include/asm/preempt.h
|
|
+++ b/arch/x86/include/asm/preempt.h
|
|
@@ -118,7 +118,7 @@ static __always_inline bool should_resched(int preempt_offset)
|
|
|
|
/* preempt count == 0 ? */
|
|
tmp &= ~PREEMPT_NEED_RESCHED;
|
|
- if (tmp)
|
|
+ if (tmp != preempt_offset)
|
|
return false;
|
|
if (current_thread_info()->preempt_lazy_count)
|
|
return false;
|
|
--
|
|
2.17.1
|
|
|