]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.17.14/nohz-fix-local_timer_softirq_pending.patch
Linux 4.14.109
[thirdparty/kernel/stable-queue.git] / releases / 4.17.14 / nohz-fix-local_timer_softirq_pending.patch
CommitLineData
dc5330ef
GKH
1From 80d20d35af1edd632a5e7a3b9c0ab7ceff92769e Mon Sep 17 00:00:00 2001
2From: Anna-Maria Gleixner <anna-maria@linutronix.de>
3Date: Tue, 31 Jul 2018 18:13:58 +0200
4Subject: nohz: Fix local_timer_softirq_pending()
5
6From: Anna-Maria Gleixner <anna-maria@linutronix.de>
7
8commit 80d20d35af1edd632a5e7a3b9c0ab7ceff92769e upstream.
9
10local_timer_softirq_pending() checks whether the timer softirq is
11pending with: local_softirq_pending() & TIMER_SOFTIRQ.
12
13This is wrong because TIMER_SOFTIRQ is the softirq number and not a
14bitmask. So the test checks for the wrong bit.
15
16Use BIT(TIMER_SOFTIRQ) instead.
17
18Fixes: 5d62c183f9e9 ("nohz: Prevent a timer interrupt storm in tick_nohz_stop_sched_tick()")
19Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
20Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
21Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
22Reviewed-by: Daniel Bristot de Oliveira <bristot@redhat.com>
23Acked-by: Frederic Weisbecker <frederic@kernel.org>
24Cc: bigeasy@linutronix.de
25Cc: peterz@infradead.org
26Cc: stable@vger.kernel.org
27Link: https://lkml.kernel.org/r/20180731161358.29472-1-anna-maria@linutronix.de
28Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29
30---
31 kernel/time/tick-sched.c | 2 +-
32 1 file changed, 1 insertion(+), 1 deletion(-)
33
34--- a/kernel/time/tick-sched.c
35+++ b/kernel/time/tick-sched.c
36@@ -642,7 +642,7 @@ static void tick_nohz_restart(struct tic
37
38 static inline bool local_timer_softirq_pending(void)
39 {
40- return local_softirq_pending() & TIMER_SOFTIRQ;
41+ return local_softirq_pending() & BIT(TIMER_SOFTIRQ);
42 }
43
44 static ktime_t tick_nohz_next_event(struct tick_sched *ts, int cpu)