linux/arch
Sergei Trofimovich aa06a9bd85 ia64: fix clock_getres(CLOCK_MONOTONIC) to report ITC frequency
clock_gettime(CLOCK_MONOTONIC, &tp) is very precise on ia64 as it uses ITC
(similar to rdtsc on x86).  It's not quite a hrtimer as it is a few times
slower than 1ns.  Usually 2-3ns.

clock_getres(CLOCK_MONOTONIC, &res) never reflected that fact and reported
0.04s precision (1/HZ value).

In https://bugs.gentoo.org/596382 gstreamer's test suite failed loudly
when it noticed precision discrepancy.

Before the change:

    clock_getres(CLOCK_MONOTONIC, &res) reported 250Hz precision.

After the change:

    clock_getres(CLOCK_MONOTONIC, &res) reports ITC (400Mhz) precision.

The patch is based on matoro's fix. I added a bit of explanation why we
need to special-case arch-specific clock_getres().

[akpm@linux-foundation.org: coding-style cleanups]
Link: https://lkml.kernel.org/r/20220820181813.2275195-1-slyich@gmail.com
Signed-off-by: Sergei Trofimovich <slyich@gmail.com>
Cc: matoro <matoro_mailinglist_kernel@matoro.tk>
Cc: Émeric Maschino <emeric.maschino@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-09-11 21:55:07 -07:00
..
alpha kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
arc kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
arm kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
arm64 kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
csky kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
hexagon kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
ia64 ia64: fix clock_getres(CLOCK_MONOTONIC) to report ITC frequency 2022-09-11 21:55:07 -07:00
loongarch kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
m68k kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
microblaze kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
mips kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
nios2 kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
openrisc kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
parisc kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
powerpc kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
riscv kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
s390 kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
sh kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
sparc kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
um kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
x86 kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
xtensa kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
.gitignore
Kconfig asm goto: eradicate CC_HAS_ASM_GOTO 2022-08-21 10:06:28 -07:00