summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@kernel.org>2018-10-05 11:02:43 -0700
committerThomas Gleixner <tglx@linutronix.de>2018-10-05 21:03:23 +0200
commit99c19e6a8fe4a95fa0dac191207a1d40461b1604 (patch)
tree04b6857951f16045aa7970c487ef1ae578e6c7d8 /lib
parentbcc4a62a73cb65327d7268fbfa3a786d603f52dc (diff)
x86/vdso: Rearrange do_hres() to improve code generation
vgetcyc() is full of barriers, so fetching values out of the vvar page before vgetcyc() for use after vgetcyc() results in poor code generation. Put vgetcyc() first to avoid this problem. Also, pull the tv_sec division into the loop and put all the ts writes together. The old code wrote ts->tv_sec on each iteration before the syscall fallback check and then added in the offset afterwards, which forced the compiler to pointlessly copy base->sec to ts->tv_sec on each iteration. The new version seems to generate sensible code. Saves several cycles. With this patch applied, the result is faster than before the clock_gettime() rewrite. Signed-off-by: Andy Lutomirski <luto@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/3c05644d010b72216aa286a6d20b5078d5fae5cd.1538762487.git.luto@kernel.org
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions