Module Name:    src
Committed By:   ad
Date:           Fri May  8 22:10:09 UTC 2020

Modified Files:
        src/external/cddl/osnet/dev/cyclic: cyclic.c
        src/sys/kern: kern_clock.c

Log Message:
Run Solaris cyclics from statclock() so dtrace isn't locked out by IPL_SCHED
(assuming the machine has a separate statclock() which almost all don't).


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/cddl/osnet/dev/cyclic/cyclic.c
cvs rdiff -u -r1.140 -r1.141 src/sys/kern/kern_clock.c

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

Modified files:

Index: src/external/cddl/osnet/dev/cyclic/cyclic.c
diff -u src/external/cddl/osnet/dev/cyclic/cyclic.c:1.8 src/external/cddl/osnet/dev/cyclic/cyclic.c:1.9
--- src/external/cddl/osnet/dev/cyclic/cyclic.c:1.8	Mon May 28 21:05:02 2018
+++ src/external/cddl/osnet/dev/cyclic/cyclic.c	Fri May  8 22:10:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cyclic.c,v 1.8 2018/05/28 21:05:02 chs Exp $	*/
+/*	$NetBSD: cyclic.c,v 1.9 2020/05/08 22:10:08 ad Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -347,7 +347,7 @@
 #include <sys/xcall.h>
 
 #undef mutex_init
-#define mtx_init(m, d, p, f) mutex_init(m, MUTEX_DEFAULT, IPL_CLOCK)
+#define mtx_init(m, d, p, f) mutex_init(m, MUTEX_DEFAULT, IPL_HIGH)
 #define mtx_lock_spin(x) mutex_spin_enter(x)
 #define mtx_unlock_spin(x) mutex_spin_exit(x)
 #define mtx_destroy(x) mutex_destroy(x)

Index: src/sys/kern/kern_clock.c
diff -u src/sys/kern/kern_clock.c:1.140 src/sys/kern/kern_clock.c:1.141
--- src/sys/kern/kern_clock.c:1.140	Thu Apr  2 16:29:30 2020
+++ src/sys/kern/kern_clock.c	Fri May  8 22:10:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_clock.c,v 1.140 2020/04/02 16:29:30 maxv Exp $	*/
+/*	$NetBSD: kern_clock.c,v 1.141 2020/05/08 22:10:09 ad Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2004, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_clock.c,v 1.140 2020/04/02 16:29:30 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_clock.c,v 1.141 2020/05/08 22:10:09 ad Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_dtrace.h"
@@ -257,13 +257,6 @@ hardclock(struct clockframe *frame)
 	 * Update real-time timeout queue.
 	 */
 	callout_hardclock();
-
-#ifdef KDTRACE_HOOKS
-	cyclic_clock_func_t func = cyclic_clock_func[cpu_index(ci)];
-	if (func) {
-		(*func)((struct clockframe *)frame);
-	}
-#endif
 }
 
 /*
@@ -431,6 +424,13 @@ statclock(struct clockframe *frame)
 		atomic_inc_uint(&l->l_cpticks);
 		mutex_spin_exit(&p->p_stmutex);
 	}
+
+#ifdef KDTRACE_HOOKS
+	cyclic_clock_func_t func = cyclic_clock_func[cpu_index(ci)];
+	if (func) {
+		(*func)((struct clockframe *)frame);
+	}
+#endif
 }
 
 /*

Reply via email to