summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorJeremie Courreges-Anglas <jca@cvs.openbsd.org>2023-12-13 18:26:42 +0000
committerJeremie Courreges-Anglas <jca@cvs.openbsd.org>2023-12-13 18:26:42 +0000
commitde5e972545b1a7c99895fb8c9bfe5a52657ad352 (patch)
tree59dd8af7942733368de725d4348a197975afcc5a /sys/arch
parent64f2f29e43834ec3a7dd4ca24c36b2f2781f0bfe (diff)
Implement per-CPU caching for the page table page (vp) pool and the PTE
descriptor (pted) pool in the [riscv64] 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 the Hifive Unmatched] Improvement and commit message adapted from kettenis' rev 1.110 commit to arm64/pmap.c. ok phessler@ kettenis@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/riscv64/include/pmap.h4
-rw-r--r--sys/arch/riscv64/riscv64/pmap.c9
2 files changed, 10 insertions, 3 deletions
diff --git a/sys/arch/riscv64/include/pmap.h b/sys/arch/riscv64/include/pmap.h
index fcfd60d63be..1f52a260ee5 100644
--- a/sys/arch/riscv64/include/pmap.h
+++ b/sys/arch/riscv64/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.9 2023/12/11 22:12:53 kettenis Exp $ */
+/* $OpenBSD: pmap.h,v 1.10 2023/12/13 18:26:41 jca Exp $ */
/*
* Copyright (c) 2019-2020 Brian Bamsch <bbamsch@google.com>
@@ -111,10 +111,10 @@ void pmap_physload_avail(void);
struct pv_entry;
/* investigate */
-#define pmap_init_percpu() do { /* nothing */ } while (0)
#define pmap_unuse_final(p) do { /* nothing */ } while (0)
int pmap_fault_fixup(pmap_t, vaddr_t, vm_prot_t);
void pmap_postinit(void);
+void pmap_init_percpu(void);
#endif /* _KERNEL && !_LOCORE */
diff --git a/sys/arch/riscv64/riscv64/pmap.c b/sys/arch/riscv64/riscv64/pmap.c
index 30db5d9b76b..1e33584f729 100644
--- a/sys/arch/riscv64/riscv64/pmap.c
+++ b/sys/arch/riscv64/riscv64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.36 2023/11/28 09:10:18 jsg Exp $ */
+/* $OpenBSD: pmap.c,v 1.37 2023/12/13 18:26:41 jca Exp $ */
/*
* Copyright (c) 2019-2020 Brian Bamsch <bbamsch@google.com>
@@ -1774,6 +1774,13 @@ pmap_postinit(void)
}
void
+pmap_init_percpu(void)
+{
+ pool_cache_init(&pmap_pted_pool);
+ pool_cache_init(&pmap_vp_pool);
+}
+
+void
pmap_update(pmap_t pm)
{
}