Hi David, thank you for reviewing my code. On 10/11/2018 00:29, David Miller wrote: > From: Vincenzo Frascino <vincenzo.frascino@xxxxxxx> > Date: Fri, 9 Nov 2018 12:37:10 +0000 > >> To take advantage of the commonly defined vdso interface for >> gettimeofday the architectural code requires an adaptation. >> >> This patch re-implements the gettimeofday vdso in C in order to use >> lib/vdso. >> >> With the new implementation arm64 gains support for CLOCK_BOOTTIME, >> CLOCK_TAI and __kernel_time. >> >> Cc: Catalin Marinas <catalin.marinas@xxxxxxx> >> Cc: Will Deacon <will.deacon@xxxxxxx> >> Signed-off-by: Vincenzo Frascino <vincenzo.frascino@xxxxxxx> > > What is the performance penalty for going to C from ASM like this? > > I like the vDSO consolidation, but actually I think it makes a lot of > sense to implement these things in assembler with some C implementation > as guidance or for architectures that haven't optimized into an ASM > version yet. > > I'd also like to see if we can somehow make PowerPC's optimizations in > this area usable in more places. > > It defines a reciprocal in order to use a multiply instead of a divide > after capturing the time values. > > I say all of this because I want to do something similar on sparc, and > having a generic implementation of all of the math would make that easier > for me and other architecture maintainers who might want to do the same. > I did run some benchmarks on arm64 with both vdsotest-bench (I added a script to the vdsotest implementation that can be used to replicate the results) and an ad-hoc test that stresses the vdso library and the differences in terms of performance penalty are very little (~1%) to none in some cases. -- Regards, Vincenzo