PERFORCE change 100007 for review

Kip Macy kmacy at FreeBSD.org
Mon Jun 26 03:10:15 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=100007

Change 100007 by kmacy at kmacy_storage:sun4v_work_sleepq on 2006/06/26 01:38:33

	tune interval at which we poll choosethread

Affected files ...

.. //depot/projects/kmacy_sun4v/src/sys/kern/kern_idle.c#8 edit

Differences ...

==== //depot/projects/kmacy_sun4v/src/sys/kern/kern_idle.c#8 (text+ko) ====

@@ -35,6 +35,7 @@
 #include <sys/proc.h>
 #include <sys/resourcevar.h>
 #include <sys/sched.h>
+#include <sys/sysctl.h>
 #include <sys/unistd.h>
 #include <sys/ktr.h>
 #ifdef SMP
@@ -45,6 +46,12 @@
 SYSINIT(idle_setup, SI_SUB_SCHED_IDLE, SI_ORDER_FIRST, idle_setup, NULL)
 
 static void idle_proc(void *dummy);
+static int interval = 10;
+
+SYSCTL_NODE(_debug, OID_AUTO, scheduler, CTLFLAG_RD, NULL, "scheduler debugging");
+SYSCTL_NODE(_debug_scheduler, OID_AUTO, idle, CTLFLAG_RD, NULL, "idle info");
+SYSCTL_INT(_debug_scheduler_idle, OID_AUTO, interval, CTLFLAG_RW,
+	   &interval, 0, "interval between idle skips");
 
 /*
  * Set up per-cpu idle process contexts.  The AP's shouldn't be running or
@@ -95,20 +102,18 @@
 static void
 idle_proc(void *dummy)
 {
-	int i;
 #ifdef SMP
 	cpumask_t mycpu;
 #endif
-
+	int i = 0;
 #ifdef SMP
 	mycpu = PCPU_GET(cpumask);
 	atomic_set_int(&idle_cpus_mask, mycpu);
 #endif
-	i = 0;
 	for (;;) {
 		mtx_assert(&Giant, MA_NOTOWNED);
 
-		while (sched_runnable() == 0 && (i++%10 != 0))
+		while (sched_runnable() == 0 && (i++%interval != 0))
 			cpu_idle();
 #ifdef SMP
 		atomic_clear_int(&idle_cpus_mask, mycpu);


More information about the p4-projects mailing list