clocksource: Make clocksource watchdog test safe for slow-HZ systems
authorPaul E. McKenney <paulmck@kernel.org>
Thu, 12 Aug 2021 16:31:28 +0000 (09:31 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 28 Aug 2021 15:01:32 +0000 (17:01 +0200)
commitd25a025201ed98f4b93775e0999a3f2135702106
tree2fcc4adf70cf9f897619f188db2dc97392667139
parent127c92feb74a6721f62587f1b89128808f049cf1
clocksource: Make clocksource watchdog test safe for slow-HZ systems

The clocksource watchdog test sets a local JIFFIES_SHIFT macro and assumes
that HZ is >= 100. For smaller HZ values this shift value is too large and
causes undefined behaviour.

Move the HZ-based definitions of JIFFIES_SHIFT from kernel/time/jiffies.c
to kernel/time/tick-internal.h so the clocksource watchdog test can utilize
them, which makes it work correctly with all HZ values.

[ tglx: Resolved conflicts and massaged changelog ]

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/lkml/20210812000133.GA402890@paulmck-ThinkPad-P17-Gen-1/
kernel/time/clocksource-wdtest.c
kernel/time/jiffies.c
kernel/time/tick-internal.h