Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apin...@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance. This will act as the basis for implementing
arm64 vdso32 in the future.


apin...@cavium.com made the following claims in the original patch:

This allows the compiler to optimize the divide by 1000 and remove
the other divides.

On ThunderX, gettimeofday improves by 32%.  On ThunderX 2,
gettimeofday improves by 18%.

Note I noticed a bug in the old implementation of __kernel_clock_getres;
it was checking only the lower 32bits of the pointer; this would work
for most cases but could fail in a few.


Signed-off-by: Mark Salyzyn <saly...@android.com>
Cc: James Morse <james.mo...@arm.com>
Cc: Russell King <li...@armlinux.org.uk>
Cc: Catalin Marinas <catalin.mari...@arm.com>
Cc: Will Deacon <will.dea...@arm.com>
Cc: Andy Lutomirski <l...@amacapital.net>
Cc: Dmitry Safonov <dsafo...@virtuozzo.com>
Cc: John Stultz <john.stu...@linaro.org>
Cc: Mark Rutland <mark.rutl...@arm.com>
Cc: Laura Abbott <labb...@redhat.com>
Cc: Kees Cook <keesc...@chromium.org>
Cc: Ard Biesheuvel <ard.biesheu...@linaro.org>
Cc: Andy Gross <andy.gr...@linaro.org>
Cc: Kevin Brodsky <kevin.brod...@arm.com>
Cc: Andrew Pinski <apin...@cavium.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org

v2:
- split first CL into 7 pieces, there were cosmetic adjustments.
- make sure profiling is turned off.
- kept quiet_cmd_vdsoas.

v3:
- changed are a result of private email review comments
- rebase
- move arch/arm/vdso/vgettimeofday.c to lib/vdso/vgettimeofday.c
- adjust vgettimeofday.c to be a better global candidate, switch to using
  ARCH_PROVIDES_TIMER and __arch_counter_get() as more generic.
- do not expose gettimeofday if arch does not support user space timer

Reply via email to