From 24f569d23f3e9d07c24cc5a5c5f1fbbc33081864 Mon Sep 17 00:00:00 2001 From: jca Date: Fri, 29 Dec 2023 13:23:27 +0000 Subject: [PATCH] Use a per cpu pool cache for pmap_pv_pool Improves performance on my 8 cores box. ok cheloha@ kettenis@ --- sys/arch/amd64/amd64/pmap.c | 8 +++++++- sys/arch/amd64/include/pmap.h | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/arch/amd64/amd64/pmap.c b/sys/arch/amd64/amd64/pmap.c index a5d2e901ac1..1886ef87322 100644 --- a/sys/arch/amd64/amd64/pmap.c +++ b/sys/arch/amd64/amd64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.164 2023/04/13 15:23:21 miod Exp $ */ +/* $OpenBSD: pmap.c,v 1.165 2023/12/29 13:23:27 jca Exp $ */ /* $NetBSD: pmap.c,v 1.3 2003/05/08 18:13:13 thorpej Exp $ */ /* @@ -913,6 +913,12 @@ pmap_bootstrap(paddr_t first_avail, paddr_t max_pa) return first_avail; } +void +pmap_init_percpu(void) +{ + pool_cache_init(&pmap_pv_pool); +} + /* * pmap_randomize * diff --git a/sys/arch/amd64/include/pmap.h b/sys/arch/amd64/include/pmap.h index 18b8779dce1..326050f4642 100644 --- a/sys/arch/amd64/include/pmap.h +++ b/sys/arch/amd64/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.87 2023/12/11 22:12:52 kettenis Exp $ */ +/* $OpenBSD: pmap.h,v 1.88 2023/12/29 13:23:28 jca Exp $ */ /* $NetBSD: pmap.h,v 1.1 2003/04/26 18:39:46 fvdl Exp $ */ /* @@ -375,7 +375,6 @@ extern const long nbpd[], nkptpmax[]; #define pmap_valid_entry(E) ((E) & PG_V) /* is PDE or PTE valid? */ #define pmap_proc_iflush(p,va,len) /* nothing */ -#define pmap_init_percpu() do { /* nothing */ } while (0) #define pmap_unuse_final(p) /* nothing */ #define pmap_remove_holes(vm) do { /* nothing */ } while (0) @@ -386,6 +385,7 @@ extern const long nbpd[], nkptpmax[]; void map_tramps(void); /* machdep.c */ paddr_t pmap_bootstrap(paddr_t, paddr_t); +void pmap_init_percpu(void); void pmap_randomize(void); void pmap_randomize_level(pd_entry_t *, int); int pmap_clear_attrs(struct vm_page *, unsigned long); -- 2.20.1