summaryrefslogtreecommitdiff
path: root/lib/vdso
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2020-04-28 16:16:53 +0300
committerThomas Gleixner <tglx@linutronix.de>2020-06-03 21:50:57 +0300
commitb91c8c42ffdd5c983923edb38b3c3e112bfe6263 (patch)
treee7eeb6e39f0036613e54215cab524b8672070072 /lib/vdso
parentf6aee505c71bbb035dde146caf5a6abbf3ccbe47 (diff)
downloadlinux-b91c8c42ffdd5c983923edb38b3c3e112bfe6263.tar.xz
lib/vdso: Force inlining of __cvdso_clock_gettime_common()
When adding gettime64() to a 32 bit architecture (namely powerpc/32) it has been noticed that GCC doesn't inline anymore __cvdso_clock_gettime_common() because it is called twice (Once by __cvdso_clock_gettime() and once by __cvdso_clock_gettime32). This has the effect of seriously degrading the performance: Before the implementation of gettime64(), gettime() runs in: clock-gettime-monotonic-raw: vdso: 1003 nsec/call clock-gettime-monotonic-coarse: vdso: 592 nsec/call clock-gettime-monotonic: vdso: 942 nsec/call When adding a gettime64() entry point, the standard gettime() performance is degraded by 30% to 50%: clock-gettime-monotonic-raw: vdso: 1300 nsec/call clock-gettime-monotonic-coarse: vdso: 900 nsec/call clock-gettime-monotonic: vdso: 1232 nsec/call Adding __always_inline() to __cvdso_clock_gettime_common() regains the original performance. In terms of code size, the inlining increases the code size by only 176 bytes. This is in the noise for a kernel image. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/1ab6a62c356c3bec35d1623563ef9c636205bcda.1588079622.git.christophe.leroy@c-s.fr
Diffstat (limited to 'lib/vdso')
-rw-r--r--lib/vdso/gettimeofday.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
index a2909af4b924..7938d3c4901d 100644
--- a/lib/vdso/gettimeofday.c
+++ b/lib/vdso/gettimeofday.c
@@ -210,7 +210,7 @@ static __always_inline int do_coarse(const struct vdso_data *vd, clockid_t clk,
return 0;
}
-static __maybe_unused int
+static __always_inline int
__cvdso_clock_gettime_common(const struct vdso_data *vd, clockid_t clock,
struct __kernel_timespec *ts)
{