]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
timers/nohz: Switch to ONESHOT_STOPPED in the low-res handler when the tick is stopped
authorNicholas Piggin <npiggin@gmail.com>
Sun, 13 Aug 2023 03:16:19 +0000 (03:16 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Aug 2023 16:22:04 +0000 (18:22 +0200)
commitb4d36e6c5dc417f3f394b5e576dec2760b3999ae
treeee803b4ef527f7646afc734fe9420b5a95d6ac0b
parentc3b954a51b6447d060c1b30ec4efb5db34a056f7
timers/nohz: Switch to ONESHOT_STOPPED in the low-res handler when the tick is stopped

[ Upstream commit 62c1256d544747b38e77ca9b5bfe3a26f9592576 ]

When tick_nohz_stop_tick() stops the tick and high resolution timers are
disabled, then the clock event device is not put into ONESHOT_STOPPED
mode. This can lead to spurious timer interrupts with some clock event
device drivers that don't shut down entirely after firing.

Eliminate these by putting the device into ONESHOT_STOPPED mode at points
where it is not being reprogrammed. When there are no timers active, then
tick_program_event() with KTIME_MAX can be used to stop the device. When
there is a timer active, the device can be stopped at the next tick (any
new timer added by timers will reprogram the tick).

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20220422141446.915024-1-npiggin@gmail.com
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/time/tick-sched.c