PERFORCE change 98498 for review

Kip Macy kmacy at FreeBSD.org
Sun Jun 4 20:28:28 UTC 2006


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

Change 98498 by kmacy at kmacy_storage:sun4v_work on 2006/06/04 20:26:43

	call choosethread instead of mi_switch to reduce the amount of time sched_lock
	is held when there is little work to be done

Affected files ...

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

Differences ...

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

@@ -78,7 +78,7 @@
 		mtx_lock_spin(&sched_lock);
 		td = FIRST_THREAD_IN_PROC(p);
 		TD_SET_CAN_RUN(td);
-		td->td_flags |= TDF_IDLETD;
+		atomic_set_int(&td->td_flags, TDF_IDLETD);
 		sched_class(td->td_ksegrp, PRI_IDLE);
 		sched_prio(td, PRI_MAX_IDLE);
 		mtx_unlock_spin(&sched_lock);
@@ -118,7 +118,8 @@
 #ifdef SMP
 		idle_cpus_mask &= ~mycpu;
 #endif
-		mi_switch(SW_VOL, NULL);
+		if ((td = choosethread()) != curthread)
+			sched_switch(curthread, td, SW_VOL);
 #ifdef SMP
 		idle_cpus_mask |= mycpu;
 #endif


More information about the p4-projects mailing list