summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2001-05-01 19:36:56 +0000
committerthorpej <thorpej@NetBSD.org>2001-05-01 19:36:56 +0000
commit01e2971ba229c8a22dcdef41efa096f7582cebbd (patch)
tree77559e5e0c4ccd908c7d3d49718a0ba001e3f5b5
parent7141c87f89d9b3033ae184760bea0ae4c2b987d4 (diff)
Add the number of page colors to uvmexp.
-rw-r--r--sys/uvm/uvm_extern.h4
-rw-r--r--sys/uvm/uvm_page.c3
-rw-r--r--usr.bin/vmstat/vmstat.c6
3 files changed, 9 insertions, 4 deletions
diff --git a/sys/uvm/uvm_extern.h b/sys/uvm/uvm_extern.h
index 30f7d4653ec..ee12bdc61b8 100644
--- a/sys/uvm/uvm_extern.h
+++ b/sys/uvm/uvm_extern.h
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_extern.h,v 1.60 2001/04/29 04:23:21 thorpej Exp $ */
+/* $NetBSD: uvm_extern.h,v 1.61 2001/05/01 19:36:56 thorpej Exp $ */
/*
*
@@ -310,6 +310,7 @@ struct uvmexp {
aborted */
int colorhit; /* pagealloc where we got optimal color */
int colormiss; /* pagealloc where we didn't */
+ int ncolors; /* number of page color buckets */
/* fault subcounters */
int fltnoram; /* number of times fault was out of ram */
@@ -435,6 +436,7 @@ struct uvmexp_sysctl {
int64_t vtextpages;
int64_t colorhit;
int64_t colormiss;
+ int64_t ncolors;
};
#ifdef _KERNEL
diff --git a/sys/uvm/uvm_page.c b/sys/uvm/uvm_page.c
index 63edd66ca80..0c7949eeea5 100644
--- a/sys/uvm/uvm_page.c
+++ b/sys/uvm/uvm_page.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_page.c,v 1.58 2001/05/01 14:02:56 enami Exp $ */
+/* $NetBSD: uvm_page.c,v 1.59 2001/05/01 19:36:57 thorpej Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -221,6 +221,7 @@ uvm_page_init(kvm_startp, kvm_endp)
* init the page queues and page queue locks
*/
+ uvmexp.ncolors = VM_PGCOLOR_BUCKETS;
for (lcv = 0; lcv < VM_NFREELIST; lcv++) {
for (color = 0; color < VM_PGCOLOR_BUCKETS; color++) {
for (i = 0; i < PGFL_NQUEUES; i++) {
diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c
index 439a0b4970d..482609d4054 100644
--- a/usr.bin/vmstat/vmstat.c
+++ b/usr.bin/vmstat/vmstat.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.79 2001/04/29 05:56:47 thorpej Exp $ */
+/* $NetBSD: vmstat.c,v 1.80 2001/05/01 19:36:58 thorpej Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -80,7 +80,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1986, 1991, 1993\n\
#if 0
static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 3/1/95";
#else
-__RCSID("$NetBSD: vmstat.c,v 1.79 2001/04/29 05:56:47 thorpej Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.80 2001/05/01 19:36:58 thorpej Exp $");
#endif
#endif /* not lint */
@@ -605,6 +605,8 @@ dosum(void)
uvmexp.colorhit);
(void)printf("%9u pagealloc desired color not avail\n",
uvmexp.colormiss);
+ (void)printf("%9u page color%s\n",
+ uvmexp.ncolors, uvmexp.ncolors == 1 ? "" : "s");
(void)printf("%9u faults with no memory\n", uvmexp.fltnoram);
(void)printf("%9u faults with no anons\n", uvmexp.fltnoanon);