summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2008-07-25 19:37:17 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2008-07-25 19:37:17 +0000
commitb97a1d8f660e2146b3aab6c7b6ba07c5c2b7eab7 (patch)
treeffdd593ef55a1b026f6a78e9d2e096986ca80dd9 /sys/arch/sparc64
parent70bbbbb58622b255a76d61035a4d8d3086fe0654 (diff)
Work around a problem on the t5120 where top(1) would lock up the system for
several minutes by making pmap_resident_count() return 0 for the kernel pmap. discussed with miod@
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r--sys/arch/sparc64/sparc64/pmap.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/arch/sparc64/sparc64/pmap.c b/sys/arch/sparc64/sparc64/pmap.c
index 46be8e6a088..1bc33e07f67 100644
--- a/sys/arch/sparc64/sparc64/pmap.c
+++ b/sys/arch/sparc64/sparc64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.65 2008/07/05 21:20:48 kettenis Exp $ */
+/* $OpenBSD: pmap.c,v 1.66 2008/07/25 19:37:16 kettenis Exp $ */
/* $NetBSD: pmap.c,v 1.107 2001/08/31 16:47:41 eeh Exp $ */
#undef NO_VCACHE /* Don't forget the locked TLB in dostart */
/*
@@ -3192,6 +3192,15 @@ pmap_count_res(pm)
paddr_t *pdir, *ptbl;
/* Almost the same as pmap_collect() */
+ /*
+ * XXX On the SPARC Enterprise T5120, counting the number of
+ * pages in the kernel pmap is ridiculously slow. Since ps(1)
+ * doesn't use the information for P_SYSTEM processes, we may
+ * as well skip the counting and return zero immediately.
+ */
+ if (pm == pmap_kernel())
+ return 0;
+
/* Don't want one of these pages reused while we're reading it. */
s = splvm();
simple_lock(&pm->pm_lock);