Module Name:    src
Committed By:   ad
Date:           Fri Dec 20 21:52:52 UTC 2019

Modified Files:
        src/sys/kern: kern_synch.c

Log Message:
Use CPU_COUNT() to update nswtch.  No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.332 -r1.333 src/sys/kern/kern_synch.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/kern/kern_synch.c
diff -u src/sys/kern/kern_synch.c:1.332 src/sys/kern/kern_synch.c:1.333
--- src/sys/kern/kern_synch.c:1.332	Mon Dec 16 20:59:39 2019
+++ src/sys/kern/kern_synch.c	Fri Dec 20 21:52:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_synch.c,v 1.332 2019/12/16 20:59:39 ad Exp $	*/
+/*	$NetBSD: kern_synch.c,v 1.333 2019/12/20 21:52:51 ad Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009, 2019
@@ -69,7 +69,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.332 2019/12/16 20:59:39 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.333 2019/12/20 21:52:51 ad Exp $");
 
 #include "opt_kstack.h"
 #include "opt_dtrace.h"
@@ -677,7 +677,7 @@ mi_switch(lwp_t *l)
 		lwp_unlock(l);
 
 		/* Count the context switch on this CPU. */
-		ci->ci_data.cpu_nswtch++;
+		CPU_COUNT(CPU_COUNT_NSWTCH, 1);
 
 		/* Update status for lwpctl, if present. */
 		if (l->l_lwpctl != NULL)
@@ -837,7 +837,7 @@ lwp_exit_switchaway(lwp_t *l)
 	spc_unlock(ci);
 
 	/* Count the context switch on this CPU. */
-	ci->ci_data.cpu_nswtch++;
+	CPU_COUNT(CPU_COUNT_NSWTCH, 1);
 
 	/* Update status for lwpctl, if present. */
 	if (l->l_lwpctl != NULL)

Reply via email to