Module Name:    src
Committed By:   rin
Date:           Wed May 27 08:47:15 UTC 2020

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

Log Message:
Tiny optimization; timecounters should not go bad ~ every ticktock.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/kern/kern_tc.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_tc.c
diff -u src/sys/kern/kern_tc.c:1.55 src/sys/kern/kern_tc.c:1.56
--- src/sys/kern/kern_tc.c:1.55	Sat May 23 23:42:43 2020
+++ src/sys/kern/kern_tc.c	Wed May 27 08:47:15 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_tc.c,v 1.55 2020/05/23 23:42:43 ad Exp $ */
+/* $NetBSD: kern_tc.c,v 1.56 2020/05/27 08:47:15 rin Exp $ */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 
 #include <sys/cdefs.h>
 /* __FBSDID("$FreeBSD: src/sys/kern/kern_tc.c,v 1.166 2005/09/19 22:16:31 andre Exp $"); */
-__KERNEL_RCSID(0, "$NetBSD: kern_tc.c,v 1.55 2020/05/23 23:42:43 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_tc.c,v 1.56 2020/05/27 08:47:15 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ntp.h"
@@ -1336,7 +1336,7 @@ tc_ticktock(void)
 		return;
 	count = 0;
 	mutex_spin_enter(&timecounter_lock);
-	if (timecounter_bad != 0) {
+	if (__predict_false(timecounter_bad != 0)) {
 		/* An existing timecounter has gone bad, pick a new one. */
 		(void)atomic_swap_uint(&timecounter_bad, 0);
 		if (timecounter->tc_quality < 0) {

Reply via email to