]> git.baikalelectronics.ru Git - kernel.git/commit
tick/sched: Use tick_next_period for lockless quick check
authorThomas Gleixner <tglx@linutronix.de>
Tue, 17 Nov 2020 13:19:45 +0000 (14:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:35:39 +0000 (11:35 +0200)
commit6138a09dde3a7cf8b250df83ed515bf47f5b61bd
tree5bfd1af8b106c0c5b04f9c12dc5a47ad0b51a935
parent22dd57d6f1ea0e72ae9efd992417655f7a30527f
tick/sched: Use tick_next_period for lockless quick check

[ Upstream commit a1a4600a6b03d12bb52001ce5b45aedc7ce19679 ]

No point in doing calculations.

   tick_next_period = last_jiffies_update + tick_period

Just check whether now is before tick_next_period to figure out whether
jiffies need an update.

Add a comment why the intentional data race in the quick check is safe or
not so safe in a 32bit corner case and why we don't worry about it.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20201117132006.337366695@linutronix.de
Stable-dep-of: e9523a0d8189 ("tick/common: Align tick period with the HZ tick.")
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/time/tick-sched.c