Work around a problem on the t5120 where top(1) would lock up the system for
authorkettenis <kettenis@openbsd.org>
Fri, 25 Jul 2008 19:37:16 +0000 (19:37 +0000)
committerkettenis <kettenis@openbsd.org>
Fri, 25 Jul 2008 19:37:16 +0000 (19:37 +0000)
several minutes by making pmap_resident_count() return 0 for the kernel pmap.

discussed with miod@

sys/arch/sparc64/sparc64/pmap.c

index 46be8e6..1bc33e0 100644 (file)
@@ -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);