Module Name:    src
Committed By:   ad
Date:           Thu Jun 11 22:25:51 UTC 2020

Modified Files:
        src/sys/uvm: uvm_pglist.c

Log Message:
Counter tweaks:

- Don't need to count anonpages+filepages any more; clean+unknown+dirty for
  each kind of page can be summed to get the totals.

- Track the number of free pages with a counter so that it's one less thing
  for the allocator to do, which opens up further options there.

- Remove cpu_count_sync_one(). It has no users and doesn't save a whole lot.
  For the cheap option, give cpu_count_sync() a boolean parameter indicating
  that a cached value is okay, and rate limit the updates for cached values
  to hz.


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/uvm/uvm_pglist.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/uvm/uvm_pglist.c
diff -u src/sys/uvm/uvm_pglist.c:1.83 src/sys/uvm/uvm_pglist.c:1.84
--- src/sys/uvm/uvm_pglist.c:1.83	Thu Jun 11 19:20:47 2020
+++ src/sys/uvm/uvm_pglist.c	Thu Jun 11 22:25:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pglist.c,v 1.83 2020/06/11 19:20:47 ad Exp $	*/
+/*	$NetBSD: uvm_pglist.c,v 1.84 2020/06/11 22:25:51 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.83 2020/06/11 19:20:47 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.84 2020/06/11 22:25:51 ad Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -98,6 +98,7 @@ uvm_pglist_add(struct vm_page *pg, struc
 #endif
 	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;

Reply via email to