]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/32: Add VDSO version of getcpu on non SMP
authorChristophe Leroy <christophe.leroy@c-s.fr>
Mon, 2 Dec 2019 07:57:27 +0000 (07:57 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 23 Jan 2020 10:31:14 +0000 (21:31 +1100)
commit84f31c7779ee349c51e12b80cf50234860abf486
tree031cb524d3cd71a32efe368600dbc1c2d93b9117
parent02e7b3da3be4781ad303c7b5913c21c61cbdb334
powerpc/32: Add VDSO version of getcpu on non SMP

Commit 08a06a5cac06 ("powerpc: Add VDSO version of getcpu") added
getcpu() for PPC64 only, by making use of a user readable general
purpose SPR.

PPC32 doesn't have any such SPR.

For non SMP, just return CPU id 0 from the VDSO directly.
PPC32 doesn't support CONFIG_NUMA so NUMA node is always 0.

Before the patch, vdsotest reported:
getcpu: syscall: 1572 nsec/call
getcpu:    libc: 1787 nsec/call
getcpu:    vdso: not tested

Now, vdsotest reports:
getcpu: syscall: 1582 nsec/call
getcpu:    libc: 502 nsec/call
getcpu:    vdso: 187 nsec/call

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/eaac4b6494ecff1811220fccc895bf282aab884a.1575273217.git.christophe.leroy@c-s.fr
arch/powerpc/kernel/vdso32/Makefile
arch/powerpc/kernel/vdso32/getcpu.S
arch/powerpc/kernel/vdso32/vdso32.lds.S