Skip to content

Commit e5bcbed

Browse files
anna-marialxgregkh
authored andcommitted
nohz: Fix local_timer_softirq_pending()
commit 80d20d3 upstream. local_timer_softirq_pending() checks whether the timer softirq is pending with: local_softirq_pending() & TIMER_SOFTIRQ. This is wrong because TIMER_SOFTIRQ is the softirq number and not a bitmask. So the test checks for the wrong bit. Use BIT(TIMER_SOFTIRQ) instead. Fixes: 5d62c18 ("nohz: Prevent a timer interrupt storm in tick_nohz_stop_sched_tick()") Signed-off-by: Anna-Maria Gleixner <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Paul E. McKenney <[email protected]> Reviewed-by: Daniel Bristot de Oliveira <[email protected]> Acked-by: Frederic Weisbecker <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a6d9dac commit e5bcbed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/time/tick-sched.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ static void tick_nohz_restart(struct tick_sched *ts, ktime_t now)
676676

677677
static inline bool local_timer_softirq_pending(void)
678678
{
679-
return local_softirq_pending() & TIMER_SOFTIRQ;
679+
return local_softirq_pending() & BIT(TIMER_SOFTIRQ);
680680
}
681681

682682
static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts,

0 commit comments

Comments
 (0)