Messages in this thread Patch in this message | | | From | Tom Zanussi <> | Subject | [PATCH 09/13] x86: lazy-preempt: properly check against preempt-mask | Date | Mon, 8 Apr 2019 14:14:11 -0500 |
| |
4.14.109-rt58-rc1 stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
[ Upstream commit 0f8a27bb5f45cc8a66f488549cecc4ce4d4533c2 ]
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> Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> --- 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.14.1
| |