]>
Commit | Line | Data |
---|---|---|
dc5330ef GKH |
1 | From 80d20d35af1edd632a5e7a3b9c0ab7ceff92769e Mon Sep 17 00:00:00 2001 |
2 | From: Anna-Maria Gleixner <anna-maria@linutronix.de> | |
3 | Date: Tue, 31 Jul 2018 18:13:58 +0200 | |
4 | Subject: nohz: Fix local_timer_softirq_pending() | |
5 | ||
6 | From: Anna-Maria Gleixner <anna-maria@linutronix.de> | |
7 | ||
8 | commit 80d20d35af1edd632a5e7a3b9c0ab7ceff92769e upstream. | |
9 | ||
10 | local_timer_softirq_pending() checks whether the timer softirq is | |
11 | pending with: local_softirq_pending() & TIMER_SOFTIRQ. | |
12 | ||
13 | This is wrong because TIMER_SOFTIRQ is the softirq number and not a | |
14 | bitmask. So the test checks for the wrong bit. | |
15 | ||
16 | Use BIT(TIMER_SOFTIRQ) instead. | |
17 | ||
18 | Fixes: 5d62c183f9e9 ("nohz: Prevent a timer interrupt storm in tick_nohz_stop_sched_tick()") | |
19 | Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> | |
20 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> | |
21 | Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | |
22 | Reviewed-by: Daniel Bristot de Oliveira <bristot@redhat.com> | |
23 | Acked-by: Frederic Weisbecker <frederic@kernel.org> | |
24 | Cc: bigeasy@linutronix.de | |
25 | Cc: peterz@infradead.org | |
26 | Cc: stable@vger.kernel.org | |
27 | Link: https://lkml.kernel.org/r/20180731161358.29472-1-anna-maria@linutronix.de | |
28 | Signed-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) |