]> git.proxmox.com Git - mirror_ubuntu-kernels.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)
commit902137ba8e469ed07c7f120a390161937a6288fb
tree031cb524d3cd71a32efe368600dbc1c2d93b9117
parent8c452a889821ca0cd2a5f2e3e87fbc01e56408cb
powerpc/32: Add VDSO version of getcpu on non SMP

Commit 18ad51dd342a ("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