Module Name:    src
Committed By:   thorpej
Date:           Mon Jul  5 15:12:01 UTC 2021

Modified Files:
        src/sys/arch/alpha/alpha: pmap.c

Log Message:
Instrument the number of calls to pmap_growkernel().


To generate a diff of this commit:
cvs rdiff -u -r1.295 -r1.296 src/sys/arch/alpha/alpha/pmap.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/alpha/alpha/pmap.c
diff -u src/sys/arch/alpha/alpha/pmap.c:1.295 src/sys/arch/alpha/alpha/pmap.c:1.296
--- src/sys/arch/alpha/alpha/pmap.c:1.295	Mon Jul  5 10:00:22 2021
+++ src/sys/arch/alpha/alpha/pmap.c	Mon Jul  5 15:12:00 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.295 2021/07/05 10:00:22 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.296 2021/07/05 15:12:00 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008, 2020
@@ -135,7 +135,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.295 2021/07/05 10:00:22 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.296 2021/07/05 15:12:00 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -258,6 +258,11 @@ int		pmap_pv_lowat __read_mostly = PMAP_
 static TAILQ_HEAD(, pmap) pmap_all_pmaps __cacheline_aligned;
 
 /*
+ * Instrument the number of calls to pmap_growkernel().
+ */
+static struct evcnt pmap_growkernel_evcnt __read_mostly;
+
+/*
  * The pools from which pmap structures and sub-structures are allocated.
  */
 static struct pool_cache pmap_pmap_cache __read_mostly;
@@ -1548,6 +1553,10 @@ pmap_init(void)
 	/* Initialize TLB handling. */
 	pmap_tlb_init();
 
+	/* Instrument pmap_growkernel(). */
+	evcnt_attach_dynamic_nozero(&pmap_growkernel_evcnt, EVCNT_TYPE_MISC,
+	    NULL, "pmap", "growkernel");
+
 	/*
 	 * Set a low water mark on the pv_entry pool, so that we are
 	 * more likely to have these around even in extreme memory
@@ -3593,6 +3602,8 @@ pmap_growkernel(vaddr_t maxkvaddr)
 	if (maxkvaddr <= virtual_end)
 		goto out;		/* we are OK */
 
+	pmap_growkernel_evcnt.ev_count++;
+
 	va = virtual_end;
 
 	while (va < maxkvaddr) {

Reply via email to