]> git.baikalelectronics.ru Git - kernel.git/commit
time/sched_clock: Use Hz as the unit for clock rate reporting below 4kHz
authorMaciej W. Rozycki <macro@orcam.me.uk>
Sun, 24 Apr 2022 11:47:26 +0000 (12:47 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 2 May 2022 12:29:04 +0000 (14:29 +0200)
commit59bca0a9e963954269b31537c1965f1c1b4ee2cc
treed2a52a8aedafe94c93d191376819d44cb720190e
parent1507faceff1e5456ffddc251543954024ebe820a
time/sched_clock: Use Hz as the unit for clock rate reporting below 4kHz

The kernel uses kHz as the unit for clock rates reported between 1MHz
(inclusive) and 4MHz (exclusive), e.g.:

 sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns

This reduces the amount of data lost due to rounding, but hasn't been
replicated for the kHz range when support was added for proper reporting of
sub-kHz clock rates.  Take the same approach for rates between 1kHz
(inclusive) and 4kHz (exclusive), which makes it consistent.

Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/alpine.DEB.2.21.2204240106380.9383@angie.orcam.me.uk
kernel/time/sched_clock.c