Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Counter tweaks:



details:   https://anonhg.NetBSD.org/src/rev/16b444376ca1
branches:  trunk
changeset: 967765:16b444376ca1
user:      ad <ad%NetBSD.org@localhost>
date:      Sat Dec 21 14:33:18 2019 +0000

description:
Counter tweaks:

"zeroaborts" + "free" don't need to be per-CPU counters, and "bucketmiss"
wasn't used.  Remove those and cluster by usage.

diffstat:

 sys/sys/cpu_data.h  |  38 +++++++++++++++-----------------------
 sys/uvm/uvm_meter.c |   7 +++----
 sys/uvm/uvm_page.c  |   6 +++---
 3 files changed, 21 insertions(+), 30 deletions(-)

diffs (139 lines):

diff -r 29406d41589b -r 16b444376ca1 sys/sys/cpu_data.h
--- a/sys/sys/cpu_data.h        Sat Dec 21 13:00:20 2019 +0000
+++ b/sys/sys/cpu_data.h        Sat Dec 21 14:33:18 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu_data.h,v 1.45 2019/12/20 21:05:34 ad Exp $ */
+/*     $NetBSD: cpu_data.h,v 1.46 2019/12/21 14:33:18 ad Exp $ */
 
 /*-
  * Copyright (c) 2004, 2006, 2007, 2008, 2019 The NetBSD Foundation, Inc.
@@ -47,55 +47,47 @@
 
 /* Per-CPU counters.  New elements must be added in blocks of 8. */
 enum cpu_count {
-       CPU_COUNT_NFAULT,               /* 0 */
-       CPU_COUNT_NSWTCH,
+       CPU_COUNT_NSWTCH,               /* 0 */
        CPU_COUNT_NSYSCALL,
        CPU_COUNT_NTRAP,
        CPU_COUNT_NINTR,
        CPU_COUNT_NSOFT,
        CPU_COUNT_FORKS,
        CPU_COUNT_FORKS_PPWAIT,
-       CPU_COUNT_FORKS_SHAREVM,        /* 8 */
-       CPU_COUNT_ANONPAGES,
+       CPU_COUNT_FORKS_SHAREVM,
+       CPU_COUNT_ANONPAGES,            /* 8 */
        CPU_COUNT_COLORHIT,
        CPU_COUNT_COLORMISS,
        CPU_COUNT_CPUHIT,
        CPU_COUNT_CPUMISS,
-       CPU_COUNT_BUCKETMISS,
        CPU_COUNT_EXECPAGES,
-       CPU_COUNT_FILEPAGES,            /* 16 */
+       CPU_COUNT_FILEPAGES,
        CPU_COUNT_PGA_ZEROHIT,
-       CPU_COUNT_PGA_ZEROMISS,
+       CPU_COUNT_PGA_ZEROMISS,         /* 16 */
        CPU_COUNT_ZEROPAGES,
-       CPU_COUNT_ZEROABORTS,
-       CPU_COUNT_FREE,
+       CPU_COUNT_PAGEINS,
        CPU_COUNT_SYNC_ONE,
        CPU_COUNT_SYNC_ALL,
-       CPU_COUNT_FLT_ACOW,             /* 24 */
+       CPU_COUNT_FLTPGWAIT,
+       CPU_COUNT_FLTRELCK,
+       CPU_COUNT_FLTRELCKOK,
+       CPU_COUNT_NFAULT,               /* 24 */
+       CPU_COUNT_FLT_ACOW,
        CPU_COUNT_FLT_ANON,
        CPU_COUNT_FLT_OBJ,
        CPU_COUNT_FLT_PRCOPY,
        CPU_COUNT_FLT_PRZERO,
        CPU_COUNT_FLTAMCOPY,
        CPU_COUNT_FLTANGET,
-       CPU_COUNT_FLTANRETRY,
-       CPU_COUNT_FLTGET,               /* 32 */
+       CPU_COUNT_FLTANRETRY,           /* 32 */
+       CPU_COUNT_FLTGET,
        CPU_COUNT_FLTLGET,
        CPU_COUNT_FLTNAMAP,
        CPU_COUNT_FLTNOMAP,
        CPU_COUNT_FLTNOANON,
        CPU_COUNT_FLTNORAM,
        CPU_COUNT_FLTPGRELE,
-       CPU_COUNT_FLTPGWAIT,
-       CPU_COUNT_FLTRELCK,             /* 40 */
-       CPU_COUNT_FLTRELCKOK,
-       CPU_COUNT_PAGEINS,
-       CPU_COUNT__SPARE1,
-       CPU_COUNT__SPARE2,
-       CPU_COUNT__SPARE3,
-       CPU_COUNT__SPARE4,
-       CPU_COUNT__SPARE5,
-       CPU_COUNT_MAX                   /* 48 */
+       CPU_COUNT_MAX                   /* 40 */
 };
 
 /*
diff -r 29406d41589b -r 16b444376ca1 sys/uvm/uvm_meter.c
--- a/sys/uvm/uvm_meter.c       Sat Dec 21 13:00:20 2019 +0000
+++ b/sys/uvm/uvm_meter.c       Sat Dec 21 14:33:18 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_meter.c,v 1.71 2019/12/21 13:00:25 ad Exp $        */
+/*     $NetBSD: uvm_meter.c,v 1.72 2019/12/21 14:33:18 ad Exp $        */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_meter.c,v 1.71 2019/12/21 13:00:25 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_meter.c,v 1.72 2019/12/21 14:33:18 ad Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -140,7 +140,7 @@
        u.forks_sharevm = cpu_count_get(CPU_COUNT_FORKS_SHAREVM);
        u.pga_zerohit = cpu_count_get(CPU_COUNT_PGA_ZEROHIT);
        u.pga_zeromiss = cpu_count_get(CPU_COUNT_PGA_ZEROMISS);
-       u.zeroaborts = cpu_count_get(CPU_COUNT_ZEROABORTS);
+       u.zeroaborts = uvmexp.zeroaborts;
        u.fltnoram = cpu_count_get(CPU_COUNT_FLTNORAM);
        u.fltnoanon = cpu_count_get(CPU_COUNT_FLTNOANON);
        u.fltpgwait = cpu_count_get(CPU_COUNT_FLTPGWAIT);
@@ -488,5 +488,4 @@
        uvmexp.execpages = (int)cpu_count_get(CPU_COUNT_EXECPAGES);
        uvmexp.colorhit = (int)cpu_count_get(CPU_COUNT_COLORHIT);
        uvmexp.colormiss = (int)cpu_count_get(CPU_COUNT_COLORMISS);
-       uvmexp.zeroaborts = (int)cpu_count_get(CPU_COUNT_ZEROABORTS);
 }
diff -r 29406d41589b -r 16b444376ca1 sys/uvm/uvm_page.c
--- a/sys/uvm/uvm_page.c        Sat Dec 21 13:00:20 2019 +0000
+++ b/sys/uvm/uvm_page.c        Sat Dec 21 14:33:18 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_page.c,v 1.207 2019/12/21 12:58:26 ad Exp $        */
+/*     $NetBSD: uvm_page.c,v 1.208 2019/12/21 14:33:18 ad Exp $        */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.207 2019/12/21 12:58:26 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.208 2019/12/21 14:33:18 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvm.h"
@@ -1485,7 +1485,7 @@
                                            PGFL_UNKNOWN], pg, listq.list);
                                        ucpu->pages[PGFL_UNKNOWN]++;
                                        uvmexp.free++;
-                                       CPU_COUNT(CPU_COUNT_ZEROABORTS, 1);
+                                       uvmexp.zeroaborts++;
                                        goto quit;
                                }
 #else



Home | Main Index | Thread Index | Old Index