Module Name:    src
Committed By:   ad
Date:           Sun Jun 14 21:41:42 UTC 2020

Modified Files:
        src/sys/arch/x86/x86: pmap.c
        src/sys/sys: cpu_data.h
        src/sys/uvm: uvm_glue.c uvm_meter.c uvm_page.c uvm_page.h
            uvm_pgflcache.c uvm_pglist.c uvm_stat.c
        src/usr.bin/vmstat: vmstat.c

Log Message:
Remove PG_ZERO.  It worked brilliantly on x86 machines from the mid-90s but
having spent an age experimenting with it over the last 6 months on various
machines and with different use cases it's always either break-even or a
slight net loss for me.


To generate a diff of this commit:
cvs rdiff -u -r1.398 -r1.399 src/sys/arch/x86/x86/pmap.c
cvs rdiff -u -r1.51 -r1.52 src/sys/sys/cpu_data.h
cvs rdiff -u -r1.180 -r1.181 src/sys/uvm/uvm_glue.c
cvs rdiff -u -r1.79 -r1.80 src/sys/uvm/uvm_meter.c
cvs rdiff -u -r1.241 -r1.242 src/sys/uvm/uvm_page.c
cvs rdiff -u -r1.104 -r1.105 src/sys/uvm/uvm_page.h
cvs rdiff -u -r1.4 -r1.5 src/sys/uvm/uvm_pgflcache.c
cvs rdiff -u -r1.84 -r1.85 src/sys/uvm/uvm_pglist.c
cvs rdiff -u -r1.45 -r1.46 src/sys/uvm/uvm_stat.c
cvs rdiff -u -r1.241 -r1.242 src/usr.bin/vmstat/vmstat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.398 src/sys/arch/x86/x86/pmap.c:1.399
--- src/sys/arch/x86/x86/pmap.c:1.398	Wed Jun  3 00:27:46 2020
+++ src/sys/arch/x86/x86/pmap.c	Sun Jun 14 21:41:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.398 2020/06/03 00:27:46 ad Exp $	*/
+/*	$NetBSD: pmap.c,v 1.399 2020/06/14 21:41:42 ad Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017, 2019, 2020 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.398 2020/06/03 00:27:46 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.399 2020/06/14 21:41:42 ad Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -3066,7 +3066,6 @@ pmap_zap_ptp(struct pmap *pmap, struct v
 		if (!pmap_valid_entry(opte)) {
 			continue;
 		}
-		pmap_pte_set(pte, 0);
 
 		/*
 		 * Count the PTE.  If it's not for a managed mapping
@@ -5741,8 +5740,6 @@ pmap_update(struct pmap *pmap)
 		PMAP_DUMMY_LOCK(pmap);
 		uvm_pagerealloc(ptp, NULL, 0);
 		PMAP_DUMMY_UNLOCK(pmap);
-
-		ptp->flags |= PG_ZERO;
 		uvm_pagefree(ptp);
 	}
 	mutex_exit(&pmap->pm_lock);

Index: src/sys/sys/cpu_data.h
diff -u src/sys/sys/cpu_data.h:1.51 src/sys/sys/cpu_data.h:1.52
--- src/sys/sys/cpu_data.h:1.51	Thu Jun 11 22:21:05 2020
+++ src/sys/sys/cpu_data.h	Sun Jun 14 21:41:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_data.h,v 1.51 2020/06/11 22:21:05 ad Exp $	*/
+/*	$NetBSD: cpu_data.h,v 1.52 2020/06/14 21:41:42 ad Exp $	*/
 
 /*-
  * Copyright (c) 2004, 2006, 2007, 2008, 2019, 2020 The NetBSD Foundation, Inc.
@@ -57,12 +57,12 @@ enum cpu_count {
 	CPU_COUNT_FORKS_SHAREVM,
 	CPU_COUNT_COLORHIT,		/* 8 */
 	CPU_COUNT_COLORMISS,
-	CPU_COUNT_PGA_ZEROHIT,
-	CPU_COUNT_PGA_ZEROMISS,
+	CPU_COUNT__UNUSED3,
+	CPU_COUNT__UNUSED4,
 	CPU_COUNT_CPUHIT,
 	CPU_COUNT_CPUMISS,
 	CPU_COUNT_FREEPAGES,
-	CPU_COUNT_ZEROPAGES,
+	CPU_COUNT__UNUSED5,
 	CPU_COUNT_PAGEINS,		/* 16 */
 	CPU_COUNT_FLTUP,
 	CPU_COUNT_FLTNOUP,

Index: src/sys/uvm/uvm_glue.c
diff -u src/sys/uvm/uvm_glue.c:1.180 src/sys/uvm/uvm_glue.c:1.181
--- src/sys/uvm/uvm_glue.c:1.180	Thu Jun 11 19:20:47 2020
+++ src/sys/uvm/uvm_glue.c	Sun Jun 14 21:41:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_glue.c,v 1.180 2020/06/11 19:20:47 ad Exp $	*/
+/*	$NetBSD: uvm_glue.c,v 1.181 2020/06/14 21:41:42 ad Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_glue.c,v 1.180 2020/06/11 19:20:47 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_glue.c,v 1.181 2020/06/14 21:41:42 ad Exp $");
 
 #include "opt_kgdb.h"
 #include "opt_kstack.h"
@@ -531,7 +531,4 @@ uvm_idle(void)
 
 	if (!ci->ci_want_resched)
 		uvmpdpol_idle(ucpu);
-	if (!ci->ci_want_resched)
-		uvm_pageidlezero();
-
 }

Index: src/sys/uvm/uvm_meter.c
diff -u src/sys/uvm/uvm_meter.c:1.79 src/sys/uvm/uvm_meter.c:1.80
--- src/sys/uvm/uvm_meter.c:1.79	Thu Jun 11 22:21:05 2020
+++ src/sys/uvm/uvm_meter.c	Sun Jun 14 21:41:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_meter.c,v 1.79 2020/06/11 22:21:05 ad Exp $	*/
+/*	$NetBSD: uvm_meter.c,v 1.80 2020/06/14 21:41:42 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.79 2020/06/11 22:21:05 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_meter.c,v 1.80 2020/06/14 21:41:42 ad Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -111,7 +111,6 @@ sysctl_vm_uvmexp2(SYSCTLFN_ARGS)
 	u.inactive = inactive;
 	u.paging = uvmexp.paging;
 	u.wired = uvmexp.wired;
-	u.zeropages = cpu_count_get(CPU_COUNT_ZEROPAGES);
 	u.reserve_pagedaemon = uvmexp.reserve_pagedaemon;
 	u.reserve_kernel = uvmexp.reserve_kernel;
 	u.freemin = uvmexp.freemin;
@@ -137,8 +136,6 @@ sysctl_vm_uvmexp2(SYSCTLFN_ARGS)
 	u.forks = cpu_count_get(CPU_COUNT_FORKS);
 	u.forks_ppwait = cpu_count_get(CPU_COUNT_FORKS_PPWAIT);
 	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 = uvmexp.zeroaborts;
 	u.fltnoram = cpu_count_get(CPU_COUNT_FLTNORAM);
 	u.fltnoanon = cpu_count_get(CPU_COUNT_FLTNOANON);
@@ -273,12 +270,6 @@ SYSCTL_SETUP(sysctl_vm_setup, "sysctl vm
 		       NULL, USPACE, NULL, 0,
 		       CTL_VM, VM_USPACE, CTL_EOL);
 	sysctl_createv(clog, 0, NULL, NULL,
-		       CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
-		       CTLTYPE_BOOL, "idlezero",
-		       SYSCTL_DESCR("Whether try to zero pages in idle loop"),
-		       NULL, 0, &vm_page_zero_enable, 0,
-		       CTL_VM, CTL_CREATE, CTL_EOL);
-	sysctl_createv(clog, 0, NULL, NULL,
 		       CTLFLAG_PERMANENT|CTLFLAG_IMMEDIATE,
 		       CTLTYPE_LONG, "minaddress",
 		       SYSCTL_DESCR("Minimum user address"),
@@ -455,7 +446,6 @@ uvm_update_uvmexp(void)
 
 	/* uvm_availmem() will sync the counters if old. */
 	uvmexp.free = (int)uvm_availmem(true);
-	uvmexp.zeropages = (int)cpu_count_get(CPU_COUNT_ZEROPAGES);
 	uvmexp.cpuhit = (int)cpu_count_get(CPU_COUNT_CPUHIT);
 	uvmexp.cpumiss = (int)cpu_count_get(CPU_COUNT_CPUMISS);
 	uvmexp.faults = (int)cpu_count_get(CPU_COUNT_NFAULT);
@@ -468,8 +458,6 @@ uvm_update_uvmexp(void)
 	uvmexp.forks = (int)cpu_count_get(CPU_COUNT_FORKS);
 	uvmexp.forks_ppwait = (int)cpu_count_get(CPU_COUNT_FORKS_PPWAIT);
 	uvmexp.forks_sharevm = (int)cpu_count_get(CPU_COUNT_FORKS_SHAREVM);
-	uvmexp.pga_zerohit = (int)cpu_count_get(CPU_COUNT_PGA_ZEROHIT);
-	uvmexp.pga_zeromiss = (int)cpu_count_get(CPU_COUNT_PGA_ZEROMISS);
 	uvmexp.fltnoram = (int)cpu_count_get(CPU_COUNT_FLTNORAM);
 	uvmexp.fltnoanon = (int)cpu_count_get(CPU_COUNT_FLTNOANON);
 	uvmexp.fltpgwait = (int)cpu_count_get(CPU_COUNT_FLTPGWAIT);

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.241 src/sys/uvm/uvm_page.c:1.242
--- src/sys/uvm/uvm_page.c:1.241	Sat Jun 13 19:55:39 2020
+++ src/sys/uvm/uvm_page.c	Sun Jun 14 21:41:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.241 2020/06/13 19:55:39 ad Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.242 2020/06/14 21:41:42 ad Exp $	*/
 
 /*-
  * Copyright (c) 2019, 2020 The NetBSD Foundation, Inc.
@@ -95,7 +95,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.241 2020/06/13 19:55:39 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.242 2020/06/14 21:41:42 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvm.h"
@@ -119,13 +119,6 @@ __KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v
 #include <uvm/uvm_pgflcache.h>
 
 /*
- * Some supported CPUs in a given architecture don't support all
- * of the things necessary to do idle page zero'ing efficiently.
- * We therefore provide a way to enable it from machdep code here.
- */
-bool vm_page_zero_enable = false;
-
-/*
  * number of pages per-CPU to reserve for the kernel.
  */
 #ifndef	UVM_RESERVED_PAGES_PER_CPU
@@ -1078,8 +1071,8 @@ uvm_pagealloc_pgb(struct uvm_cpu *ucpu, 
 			 * lock because of uvm_pglistalloc().
 			 */
 			LIST_REMOVE(pg, pageq.list);
-			KASSERT(pg->flags & PG_FREE);
-			pg->flags &= PG_ZERO;
+			KASSERT(pg->flags == PG_FREE);
+			pg->flags = PG_BUSY | PG_CLEAN | PG_FAKE;
 			pgb->pgb_nfree--;
 
 			/*
@@ -1154,8 +1147,8 @@ uvm_pagealloc_pgfl(struct uvm_cpu *ucpu,
  * => caller must activate/deactivate page if it is not wired.
  * => free_list is ignored if strat == UVM_PGA_STRAT_NORMAL.
  * => policy decision: it is more important to pull a page off of the
- *	appropriate priority free list than it is to get a zero'd or
- *	unknown contents page.  This is because we live with the
+ *	appropriate priority free list than it is to get a page from the
+ *	correct bucket or color bin.  This is because we live with the
  *	consequences of a bad free list decision for the entire
  *	lifetime of the page, e.g. if the page comes from memory that
  *	is slower to access.
@@ -1165,8 +1158,7 @@ struct vm_page *
 uvm_pagealloc_strat(struct uvm_object *obj, voff_t off, struct vm_anon *anon,
     int flags, int strat, int free_list)
 {
-	int zeroit = 0, color;
-	int lcv, error, s;
+	int color, lcv, error, s;
 	struct uvm_cpu *ucpu;
 	struct vm_page *pg;
 	lwp_t *l;
@@ -1280,28 +1272,15 @@ uvm_pagealloc_strat(struct uvm_object *o
 	ucpu->pgflcolor = (color + 1) & uvmexp.colormask;
 
 	/*
-	 * while still at IPL_VM, update allocation statistics and remember
-	 * if we have to zero the page
+	 * while still at IPL_VM, update allocation statistics.
 	 */
 
     	CPU_COUNT(CPU_COUNT_FREEPAGES, -1);
-	if (flags & UVM_PGA_ZERO) {
-		if (pg->flags & PG_ZERO) {
-		    	CPU_COUNT(CPU_COUNT_PGA_ZEROHIT, 1);
-			zeroit = 0;
-		} else {
-		    	CPU_COUNT(CPU_COUNT_PGA_ZEROMISS, 1);
-			zeroit = 1;
-		}
-	}
-	if (pg->flags & PG_ZERO) {
-	    	CPU_COUNT(CPU_COUNT_ZEROPAGES, -1);
-	}
 	if (anon) {
 		CPU_COUNT(CPU_COUNT_ANONCLEAN, 1);
 	}
 	splx(s);
-	KASSERT((pg->flags & ~(PG_ZERO|PG_FREE)) == 0);
+	KASSERT(pg->flags == (PG_BUSY|PG_CLEAN|PG_FAKE));
 
 	/*
 	 * assign the page to the object.  as the page was free, we know
@@ -1315,7 +1294,6 @@ uvm_pagealloc_strat(struct uvm_object *o
 	pg->uobject = obj;
 	pg->uanon = anon;
 	KASSERT(uvm_page_owner_locked_p(pg, true));
-	pg->flags = PG_BUSY|PG_CLEAN|PG_FAKE;
 	if (anon) {
 		anon->an_page = pg;
 		pg->flags |= PG_ANON;
@@ -1347,16 +1325,11 @@ uvm_pagealloc_strat(struct uvm_object *o
 	UVM_PAGE_OWN(pg, "new alloc");
 
 	if (flags & UVM_PGA_ZERO) {
-		/*
-		 * A zero'd page is not clean.  If we got a page not already
-		 * zero'd, then we have to zero it ourselves.
-		 */
+		/* A zero'd page is not clean. */
 		if (obj != NULL || anon != NULL) {
 			uvm_pagemarkdirty(pg, UVM_PAGE_STATUS_DIRTY);
 		}
-		if (zeroit) {
-			pmap_zero_page(VM_PAGE_TO_PHYS(pg));
-		}
+		pmap_zero_page(VM_PAGE_TO_PHYS(pg));
 	}
 
 	return(pg);
@@ -1477,7 +1450,7 @@ uvm_pagezerocheck(struct vm_page *pg)
 	pmap_update(pmap_kernel());
 	while (p < ep) {
 		if (*p != 0)
-			panic("PG_ZERO page isn't zero-filled");
+			panic("zero page isn't zero-filled");
 		p++;
 	}
 	pmap_kremove(uvm_zerocheckkva, PAGE_SIZE);
@@ -1633,16 +1606,11 @@ uvm_pagefree(struct vm_page *pg)
 #ifdef DEBUG
 	pg->uobject = (void *)0xdeadbeef;
 	pg->uanon = (void *)0xdeadbeef;
-	if (pg->flags & PG_ZERO)
-		uvm_pagezerocheck(pg);
 #endif /* DEBUG */
 
 	/* Try to send the page to the per-CPU cache. */
 	s = splvm();
     	CPU_COUNT(CPU_COUNT_FREEPAGES, 1);
-	if (pg->flags & PG_ZERO) {
-	    	CPU_COUNT(CPU_COUNT_ZEROPAGES, 1);
-	}
 	ucpu = curcpu()->ci_data.cpu_uvm;
 	bucket = uvm_page_get_bucket(pg);
 	if (bucket == ucpu->pgflbucket && uvm_pgflcache_free(ucpu, pg)) {
@@ -1657,7 +1625,7 @@ uvm_pagefree(struct vm_page *pg)
 
 	mutex_spin_enter(lock);
 	/* PG_FREE must be set under lock because of uvm_pglistalloc(). */
-	pg->flags = (pg->flags & PG_ZERO) | PG_FREE;
+	pg->flags = PG_FREE;
 	LIST_INSERT_HEAD(&pgb->pgb_colors[VM_PGCOLOR(pg)], pg, pageq.list);
 	pgb->pgb_nfree++;
 	mutex_spin_exit(lock);
@@ -1811,20 +1779,6 @@ uvm_page_own(struct vm_page *pg, const c
 #endif
 
 /*
- * uvm_pageidlezero: zero free pages while the system is idle.
- */
-void
-uvm_pageidlezero(void)
-{
-
-	/*
-	 * Disabled for the moment.  Previous strategy too cache heavy.  In
-	 * the future we may experiment with zeroing the pages held in the
-	 * per-CPU cache (uvm_pgflcache).
-	 */
-}
-
-/*
  * uvm_pagelookup: look up a page
  *
  * => caller should lock object to keep someone from pulling the page

Index: src/sys/uvm/uvm_page.h
diff -u src/sys/uvm/uvm_page.h:1.104 src/sys/uvm/uvm_page.h:1.105
--- src/sys/uvm/uvm_page.h:1.104	Sun May 24 19:46:59 2020
+++ src/sys/uvm/uvm_page.h	Sun Jun 14 21:41:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.h,v 1.104 2020/05/24 19:46:59 ad Exp $	*/
+/*	$NetBSD: uvm_page.h,v 1.105 2020/06/14 21:41:42 ad Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -233,11 +233,6 @@ struct vm_page {
  * PG_RDONLY:
  *	Indicates that the page must be mapped read-only.
  *
- * PG_ZERO:
- *	Indicates that the page has been pre-zeroed.  This flag is only
- *	set when the page is not in the queues and is cleared when the
- *	page is placed on the free list.
- *
  * PG_MARKER:
  *	Dummy marker page, generally used for list traversal.
  */
@@ -254,7 +249,6 @@ struct vm_page {
 #define	PG_RELEASED	0x00000020	/* page to be freed when unbusied */
 #define	PG_FAKE		0x00000040	/* page is not yet initialized */
 #define	PG_RDONLY	0x00000080	/* page must be mapped read-only */
-#define	PG_ZERO		0x00000100	/* page is pre-zero'd */
 #define	PG_TABLED	0x00000200	/* page is tabled in object */
 #define	PG_AOBJ		0x00000400	/* page is part of an anonymous
 					   uvm_object */
@@ -332,12 +326,6 @@ struct vm_page {
 #ifdef _KERNEL
 
 /*
- * globals
- */
-
-extern bool vm_page_zero_enable;
-
-/*
  * prototypes: the following prototypes define the interface to pages
  */
 
@@ -350,7 +338,6 @@ bool uvm_page_physget(paddr_t *);
 #endif
 void uvm_page_recolor(int);
 void uvm_page_rebucket(void);
-void uvm_pageidlezero(void);
 
 void uvm_pageactivate(struct vm_page *);
 vaddr_t uvm_pageboot_alloc(vsize_t);

Index: src/sys/uvm/uvm_pgflcache.c
diff -u src/sys/uvm/uvm_pgflcache.c:1.4 src/sys/uvm/uvm_pgflcache.c:1.5
--- src/sys/uvm/uvm_pgflcache.c:1.4	Mon Dec 30 17:47:06 2019
+++ src/sys/uvm/uvm_pgflcache.c	Sun Jun 14 21:41:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pgflcache.c,v 1.4 2019/12/30 17:47:06 ad Exp $	*/
+/*	$NetBSD: uvm_pgflcache.c,v 1.5 2020/06/14 21:41:42 ad Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_pgflcache.c,v 1.4 2019/12/30 17:47:06 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pgflcache.c,v 1.5 2020/06/14 21:41:42 ad Exp $");
 
 #include "opt_uvm.h"
 #include "opt_multiprocessor.h"
@@ -217,10 +217,10 @@ uvm_pgflcache_alloc(struct uvm_cpu *ucpu
 	}
 	pg = pcc->pages[--(pcc->count)];
 	KASSERT(pg != NULL);
-	KASSERT(pg->flags & PG_FREE);
+	KASSERT(pg->flags == PG_FREE);
 	KASSERT(uvm_page_get_freelist(pg) == fl);
 	KASSERT(uvm_page_get_bucket(pg) == ucpu->pgflbucket);
-	pg->flags &= PG_ZERO;
+	pg->flags = PG_BUSY | PG_CLEAN | PG_FAKE;
 	return pg;
 }
 
@@ -253,7 +253,7 @@ uvm_pgflcache_free(struct uvm_cpu *ucpu,
 	if (__predict_false(pcc->count == MAXPGS)) {
 		uvm_pgflcache_spill(ucpu, fl, c);
 	}
-	pg->flags = (pg->flags & PG_ZERO) | PG_FREE;
+	pg->flags = PG_FREE;
 	pcc->pages[pcc->count] = pg;
 	pcc->count++;
 	return true;

Index: src/sys/uvm/uvm_pglist.c
diff -u src/sys/uvm/uvm_pglist.c:1.84 src/sys/uvm/uvm_pglist.c:1.85
--- src/sys/uvm/uvm_pglist.c:1.84	Thu Jun 11 22:25:51 2020
+++ src/sys/uvm/uvm_pglist.c	Sun Jun 14 21:41:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pglist.c,v 1.84 2020/06/11 22:25:51 ad Exp $	*/
+/*	$NetBSD: uvm_pglist.c,v 1.85 2020/06/14 21:41:42 ad Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2019 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.84 2020/06/11 22:25:51 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.85 2020/06/14 21:41:42 ad Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -99,8 +99,6 @@ uvm_pglist_add(struct vm_page *pg, struc
 	LIST_REMOVE(pg, pageq.list);
 	pgb->pgb_nfree--;
     	CPU_COUNT(CPU_COUNT_FREEPAGES, -1);
-	if (pg->flags & PG_ZERO)
-		CPU_COUNT(CPU_COUNT_ZEROPAGES, -1);
 	pg->flags = PG_CLEAN;
 	pg->uobject = NULL;
 	pg->uanon = NULL;

Index: src/sys/uvm/uvm_stat.c
diff -u src/sys/uvm/uvm_stat.c:1.45 src/sys/uvm/uvm_stat.c:1.46
--- src/sys/uvm/uvm_stat.c:1.45	Thu Jun 11 22:21:05 2020
+++ src/sys/uvm/uvm_stat.c	Sun Jun 14 21:41:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_stat.c,v 1.45 2020/06/11 22:21:05 ad Exp $	 */
+/*	$NetBSD: uvm_stat.c,v 1.46 2020/06/14 21:41:42 ad Exp $	 */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_stat.c,v 1.45 2020/06/11 22:21:05 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_stat.c,v 1.46 2020/06/14 21:41:42 ad Exp $");
 
 #include "opt_readahead.h"
 #include "opt_ddb.h"
@@ -84,9 +84,8 @@ uvmexp_print(void (*pr)(const char *, ..
 	    anonpg, filepg, execpg);
 	(*pr)("  freemin=%d, free-target=%d, wired-max=%d\n",
 	    uvmexp.freemin, uvmexp.freetarg, uvmexp.wiredmax);
-	(*pr)("  resv-pg=%d, resv-kernel=%d, zeropages=%" PRId64 "\n",
-	    uvmexp.reserve_pagedaemon, uvmexp.reserve_kernel,
-	    cpu_count_get(CPU_COUNT_ZEROPAGES));
+	(*pr)("  resv-pg=%d, resv-kernel=%d\n",
+	    uvmexp.reserve_pagedaemon, uvmexp.reserve_kernel);
 	(*pr)("  bootpages=%d, poolpages=%d\n",
 	    uvmexp.bootpages, poolpages);
 

Index: src/usr.bin/vmstat/vmstat.c
diff -u src/usr.bin/vmstat/vmstat.c:1.241 src/usr.bin/vmstat/vmstat.c:1.242
--- src/usr.bin/vmstat/vmstat.c:1.241	Sun Jun 14 21:34:25 2020
+++ src/usr.bin/vmstat/vmstat.c	Sun Jun 14 21:41:42 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.241 2020/06/14 21:34:25 ad Exp $ */
+/* $NetBSD: vmstat.c,v 1.242 2020/06/14 21:41:42 ad Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007, 2019, 2020
@@ -71,7 +71,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)vmstat.c	8.2 (Berkeley) 3/1/95";
 #else
-__RCSID("$NetBSD: vmstat.c,v 1.241 2020/06/14 21:34:25 ad Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.242 2020/06/14 21:41:42 ad Exp $");
 #endif
 #endif /* not lint */
 
@@ -921,7 +921,6 @@ dosum(void)
 		COPY(free);
 		COPY(paging);
 		COPY(wired);
-		COPY(zeropages);
 		COPY(reserve_pagedaemon);
 		COPY(reserve_kernel);
 		COPY(anonpages);
@@ -941,9 +940,6 @@ dosum(void)
 		COPY(forks);
 		COPY(forks_ppwait);
 		COPY(forks_sharevm);
-		COPY(pga_zerohit);
-		COPY(pga_zeromiss);
-		COPY(zeroaborts);
 		COPY(colorhit);
 		COPY(colormiss);
 		COPY(cpuhit);
@@ -1006,7 +1002,6 @@ dosum(void)
 	}
 	(void)printf("%9" PRIu64 " pages paging\n", uvmexp.paging);
 	(void)printf("%9" PRIu64 " pages wired\n", uvmexp.wired);
-	(void)printf("%9" PRIu64 " zero pages\n", uvmexp.zeropages);
 	(void)printf("%9" PRIu64 " reserve pagedaemon pages\n",
 	    uvmexp.reserve_pagedaemon);
 	(void)printf("%9" PRIu64 " reserve kernel pages\n", uvmexp.reserve_kernel);
@@ -1041,12 +1036,6 @@ dosum(void)
 	(void)printf("%9" PRIu64 " forks blocked parent\n", uvmexp.forks_ppwait);
 	(void)printf("%9" PRIu64 " forks shared address space with parent\n",
 	    uvmexp.forks_sharevm);
-	(void)printf("%9" PRIu64 " pagealloc zero wanted and avail\n",
-	    uvmexp.pga_zerohit);
-	(void)printf("%9" PRIu64 " pagealloc zero wanted and not avail\n",
-	    uvmexp.pga_zeromiss);
-	(void)printf("%9" PRIu64 " aborts of idle page zeroing\n",
-	    uvmexp.zeroaborts);
 	(void)printf("%9" PRIu64 " pagealloc desired color avail\n",
 	    uvmexp.colorhit);
 	(void)printf("%9" PRIu64 " pagealloc desired color not avail\n",

Reply via email to