Wed Dec 17 17:58:03 2014 UTC ()
Pull up following revision(s) (requested by msaitoh in ticket #329):
	sys/uvm/uvm_meter.c: revision 1.64
	sys/uvm/uvm_meter.c: revision 1.65
Fix a bug that "vmstat -s" prints uvmexp.ncolors incorrectly.
Sort in uvmexp_sysctl's order for readability. No functional change.


(martin)
diff -r1.63 -r1.63.4.1 src/sys/uvm/uvm_meter.c

cvs diff -r1.63 -r1.63.4.1 src/sys/uvm/uvm_meter.c (expand / switch to unified diff)

--- src/sys/uvm/uvm_meter.c 2014/02/26 20:33:53 1.63
+++ src/sys/uvm/uvm_meter.c 2014/12/17 17:58:03 1.63.4.1
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: uvm_meter.c,v 1.63 2014/02/26 20:33:53 martin Exp $ */ 1/* $NetBSD: uvm_meter.c,v 1.63.4.1 2014/12/17 17:58:03 martin Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1997 Charles D. Cranor and Washington University. 4 * Copyright (c) 1997 Charles D. Cranor and Washington University.
5 * Copyright (c) 1982, 1986, 1989, 1993 5 * Copyright (c) 1982, 1986, 1989, 1993
6 * The Regents of the University of California. 6 * The Regents of the University of California.
7 * 7 *
8 * All rights reserved. 8 * All rights reserved.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -26,27 +26,27 @@ @@ -26,27 +26,27 @@
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 * 33 *
34 * @(#)vm_meter.c 8.4 (Berkeley) 1/4/94 34 * @(#)vm_meter.c 8.4 (Berkeley) 1/4/94
35 * from: Id: uvm_meter.c,v 1.1.2.1 1997/08/14 19:10:35 chuck Exp 35 * from: Id: uvm_meter.c,v 1.1.2.1 1997/08/14 19:10:35 chuck Exp
36 */ 36 */
37 37
38#include <sys/cdefs.h> 38#include <sys/cdefs.h>
39__KERNEL_RCSID(0, "$NetBSD: uvm_meter.c,v 1.63 2014/02/26 20:33:53 martin Exp $"); 39__KERNEL_RCSID(0, "$NetBSD: uvm_meter.c,v 1.63.4.1 2014/12/17 17:58:03 martin Exp $");
40 40
41#include <sys/param.h> 41#include <sys/param.h>
42#include <sys/systm.h> 42#include <sys/systm.h>
43#include <sys/cpu.h> 43#include <sys/cpu.h>
44#include <sys/proc.h> 44#include <sys/proc.h>
45#include <sys/kernel.h> 45#include <sys/kernel.h>
46#include <sys/sysctl.h> 46#include <sys/sysctl.h>
47 47
48#include <uvm/uvm.h> 48#include <uvm/uvm.h>
49#include <uvm/uvm_pdpolicy.h> 49#include <uvm/uvm_pdpolicy.h>
50 50
51/* 51/*
52 * maxslp: ???? XXXCDC 52 * maxslp: ???? XXXCDC
@@ -113,26 +113,28 @@ sysctl_vm_uvmexp2(SYSCTLFN_ARGS) @@ -113,26 +113,28 @@ sysctl_vm_uvmexp2(SYSCTLFN_ARGS)
113 u.wired = uvmexp.wired; 113 u.wired = uvmexp.wired;
114 u.zeropages = uvmexp.zeropages; 114 u.zeropages = uvmexp.zeropages;
115 u.reserve_pagedaemon = uvmexp.reserve_pagedaemon; 115 u.reserve_pagedaemon = uvmexp.reserve_pagedaemon;
116 u.reserve_kernel = uvmexp.reserve_kernel; 116 u.reserve_kernel = uvmexp.reserve_kernel;
117 u.freemin = uvmexp.freemin; 117 u.freemin = uvmexp.freemin;
118 u.freetarg = uvmexp.freetarg; 118 u.freetarg = uvmexp.freetarg;
119 u.inactarg = 0; /* unused */ 119 u.inactarg = 0; /* unused */
120 u.wiredmax = uvmexp.wiredmax; 120 u.wiredmax = uvmexp.wiredmax;
121 u.nswapdev = uvmexp.nswapdev; 121 u.nswapdev = uvmexp.nswapdev;
122 u.swpages = uvmexp.swpages; 122 u.swpages = uvmexp.swpages;
123 u.swpginuse = uvmexp.swpginuse; 123 u.swpginuse = uvmexp.swpginuse;
124 u.swpgonly = uvmexp.swpgonly; 124 u.swpgonly = uvmexp.swpgonly;
125 u.nswget = uvmexp.nswget; 125 u.nswget = uvmexp.nswget;
 126 u.cpuhit = uvmexp.cpuhit;
 127 u.cpumiss = uvmexp.cpumiss;
126 for (CPU_INFO_FOREACH(cii, ci)) { 128 for (CPU_INFO_FOREACH(cii, ci)) {
127 u.faults += ci->ci_data.cpu_nfault; 129 u.faults += ci->ci_data.cpu_nfault;
128 u.traps += ci->ci_data.cpu_ntrap; 130 u.traps += ci->ci_data.cpu_ntrap;
129 u.intrs += ci->ci_data.cpu_nintr; 131 u.intrs += ci->ci_data.cpu_nintr;
130 u.swtch += ci->ci_data.cpu_nswtch; 132 u.swtch += ci->ci_data.cpu_nswtch;
131 u.softs += ci->ci_data.cpu_nsoft; 133 u.softs += ci->ci_data.cpu_nsoft;
132 u.syscalls += ci->ci_data.cpu_nsyscall; 134 u.syscalls += ci->ci_data.cpu_nsyscall;
133 } 135 }
134 u.pageins = uvmexp.pageins; 136 u.pageins = uvmexp.pageins;
135 u.pgswapin = uvmexp.pgswapin; 137 u.pgswapin = uvmexp.pgswapin;
136 u.pgswapout = uvmexp.pgswapout; 138 u.pgswapout = uvmexp.pgswapout;
137 u.forks = uvmexp.forks; 139 u.forks = uvmexp.forks;
138 u.forks_ppwait = uvmexp.forks_ppwait; 140 u.forks_ppwait = uvmexp.forks_ppwait;
@@ -164,28 +166,27 @@ sysctl_vm_uvmexp2(SYSCTLFN_ARGS) @@ -164,28 +166,27 @@ sysctl_vm_uvmexp2(SYSCTLFN_ARGS)
164 u.pdscans = uvmexp.pdscans; 166 u.pdscans = uvmexp.pdscans;
165 u.pdanscan = uvmexp.pdanscan; 167 u.pdanscan = uvmexp.pdanscan;
166 u.pdobscan = uvmexp.pdobscan; 168 u.pdobscan = uvmexp.pdobscan;
167 u.pdreact = uvmexp.pdreact; 169 u.pdreact = uvmexp.pdreact;
168 u.pdbusy = uvmexp.pdbusy; 170 u.pdbusy = uvmexp.pdbusy;
169 u.pdpageouts = uvmexp.pdpageouts; 171 u.pdpageouts = uvmexp.pdpageouts;
170 u.pdpending = uvmexp.pdpending; 172 u.pdpending = uvmexp.pdpending;
171 u.pddeact = uvmexp.pddeact; 173 u.pddeact = uvmexp.pddeact;
172 u.anonpages = uvmexp.anonpages; 174 u.anonpages = uvmexp.anonpages;
173 u.filepages = uvmexp.filepages; 175 u.filepages = uvmexp.filepages;
174 u.execpages = uvmexp.execpages; 176 u.execpages = uvmexp.execpages;
175 u.colorhit = uvmexp.colorhit; 177 u.colorhit = uvmexp.colorhit;
176 u.colormiss = uvmexp.colormiss; 178 u.colormiss = uvmexp.colormiss;
177 u.cpuhit = uvmexp.cpuhit; 179 u.ncolors = uvmexp.ncolors;
178 u.cpumiss = uvmexp.cpumiss; 
179 180
180 node = *rnode; 181 node = *rnode;
181 node.sysctl_data = &u; 182 node.sysctl_data = &u;
182 node.sysctl_size = sizeof(u); 183 node.sysctl_size = sizeof(u);
183 if (oldlenp) 184 if (oldlenp)
184 node.sysctl_size = min(*oldlenp, node.sysctl_size); 185 node.sysctl_size = min(*oldlenp, node.sysctl_size);
185 return (sysctl_lookup(SYSCTLFN_CALL(&node))); 186 return (sysctl_lookup(SYSCTLFN_CALL(&node)));
186} 187}
187 188
188/* 189/*
189 * sysctl helper routine for uvm_pctparam. 190 * sysctl helper routine for uvm_pctparam.
190 */ 191 */
191static int 192static int