From 01e2971ba229c8a22dcdef41efa096f7582cebbd Mon Sep 17 00:00:00 2001 From: thorpej Date: Tue, 1 May 2001 19:36:56 +0000 Subject: [PATCH] Add the number of page colors to uvmexp. --- sys/uvm/uvm_extern.h | 4 +++- sys/uvm/uvm_page.c | 3 ++- usr.bin/vmstat/vmstat.c | 6 ++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/uvm/uvm_extern.h b/sys/uvm/uvm_extern.h index 30f7d4653ec4..ee12bdc61b81 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 63edd66ca800..0c7949eeea53 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 439a0b4970dc..482609d40547 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);