Date: Sun, 4 Jun 2006 20:26:44 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 98498 for review Message-ID: <200606042026.k54KQi8h051743@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=98498 Change 98498 by kmacy@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606042026.k54KQi8h051743>