Implement per-CPU caching for the page table page (vp) pool and the PTE
authorkettenis <kettenis@openbsd.org>
Mon, 11 Dec 2023 22:12:52 +0000 (22:12 +0000)
committerkettenis <kettenis@openbsd.org>
Mon, 11 Dec 2023 22:12:52 +0000 (22:12 +0000)
commit551b33bfef6b7c53ceaddc2f1c22f6a9f6d18050
treeaa4496a5229ab3598b05925d338eae01a8b59812
parent615efeafe40e41cdd08dc80cef61caac59164962
Implement per-CPU caching for the page table page (vp) pool and the PTE
descriptor (pted) pool in the arm64 pmap implementation.  This
significantly reduces the side-effects of lock contention on the kernel
map lock that is (incorrectly) translated into excessive page daemon
wakeups.  This is not a perfect solution but it does lead to significant
speedups on machines with many CPU cores.

This requires adding a new pmap_init_percpu() function that gets called
at the point where kernel is ready to set up the per-CPU pool caches.
Dummy implementations of this function are added for all non-arm64
architectures.  Some other architectures can probably benefit from
providing an actual implementation that sets up per-CPU caches for
pmap pools as well.

ok phessler@, claudio@, miod@, patrick@
15 files changed:
sys/arch/alpha/include/pmap.h
sys/arch/amd64/include/pmap.h
sys/arch/arm/include/pmap.h
sys/arch/arm64/arm64/pmap.c
sys/arch/arm64/include/pmap.h
sys/arch/hppa/include/pmap.h
sys/arch/i386/include/pmap.h
sys/arch/m88k/include/pmap.h
sys/arch/mips64/include/pmap.h
sys/arch/powerpc/include/pmap.h
sys/arch/powerpc64/include/pmap.h
sys/arch/riscv64/include/pmap.h
sys/arch/sh/include/pmap.h
sys/arch/sparc64/include/pmap.h
sys/kern/init_main.c