[PATCH] [RFC] powerpc: Add VDSO version of time

Anton Blanchard anton at samba.org
Fri Apr 19 08:38:35 EST 2013


Hi Adhemerval,

> This patch implement the time syscall as vDSO. I have a glibc patch
> to use it as IFUNC (as latest gettimeofday patch). Below the perf
> numbers:
> 
> Baseline PPC32: 380 nsec
> Baseline PPC64: 352 nsec
> vdso PPC32:      20 nsec
> vdso PPC64:      20 nsec

Very nice speedup. One small performance improvement:

+1:	ld	r8,CFG_TB_UPDATE_COUNT(r3)
+	ld	r4,STAMP_XTIME+TSPC64_TV_SEC(r3)
+	andi.	r0,r8,1			/* pending update ? loop */
+	bne-	1b

Since you are only reading one long you shouldn't need to check the
update count and loop, you will always see a consistent value. The
system call version of time() just does an unprotected load for example.

> I focused on 64 bit kernel, do I need to provide a scheme for 32 bits
> as well?
> 
> Any tips, advices, comments?

With the above change and with Michael's comments covered (decent
changelog entry and Signed-off-by):

Acked-by: Anton Blanchard <anton at samba.org>

Anton


More information about the Linuxppc-dev mailing list