Skip to content

Commit 80d20d3

Browse files
anna-marialxKAGA-KOKO
authored andcommitted
nohz: Fix local_timer_softirq_pending()
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]
1 parent acb1872 commit 80d20d3

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
@@ -642,7 +642,7 @@ static void tick_nohz_restart(struct tick_sched *ts, ktime_t now)
642642

643643
static inline bool local_timer_softirq_pending(void)
644644
{
645-
return local_softirq_pending() & TIMER_SOFTIRQ;
645+
return local_softirq_pending() & BIT(TIMER_SOFTIRQ);
646646
}
647647

648648
static ktime_t tick_nohz_next_event(struct tick_sched *ts, int cpu)

0 commit comments

Comments
 (0)