From: kettenis Date: Fri, 25 Jul 2008 19:37:16 +0000 (+0000) Subject: Work around a problem on the t5120 where top(1) would lock up the system for X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ef642599c078b0a2bd2f1c29bb1be9b3f317b614;p=openbsd 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@ --- 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);