PERFORCE change 61257 for review
John Baldwin
jhb at FreeBSD.org
Thu Sep 9 12:49:35 PDT 2004
http://perforce.freebsd.org/chv.cgi?CH=61257
Change 61257 by jhb at jhb_slimer on 2004/09/09 19:48:37
Minor nits I noticed while looking in here:
- Just use sched_prio() directly rather than taking the long detour
through the rtprio crap.
- Only switch away if there is another runnable thread, switching
away when there isn't is just stupid as we end up switching right
back to ourselves which only serves to waste time.
Affected files ...
.. //depot/projects/smpng/sys/vm/vm_zeroidle.c#19 edit
Differences ...
==== //depot/projects/smpng/sys/vm/vm_zeroidle.c#19 (text+ko) ====
@@ -138,36 +138,28 @@
vm_pagezero(void __unused *arg)
{
struct proc *p;
- struct rtprio rtp;
struct thread *td;
- int pages, pri;
td = curthread;
p = td->td_proc;
- rtp.prio = RTP_PRIO_MAX;
- rtp.type = RTP_PRIO_IDLE;
- pages = 0;
mtx_lock_spin(&sched_lock);
- rtp_to_pri(&rtp, td->td_ksegrp);
- pri = td->td_priority;
+ sched_prio(td, PRI_MAX_IDLE);
mtx_unlock_spin(&sched_lock);
idlezero_enable = idlezero_enable_default;
for (;;) {
if (vm_page_zero_check()) {
- pages += vm_page_zero_idle();
+ vm_page_zero_idle();
#ifndef PREEMPTION
- if (pages > idlezero_maxrun || sched_runnable()) {
+ if (sched_runnable()) {
mtx_lock_spin(&sched_lock);
mi_switch(SW_VOL, NULL);
mtx_unlock_spin(&sched_lock);
- pages = 0;
}
#endif
- } else {
- tsleep(&zero_state, pri, "pgzero", hz * 300);
- pages = 0;
- }
+ } else
+ tsleep(&zero_state, td->td_priority, "pgzero",
+ hz * 300);
}
}
More information about the p4-projects
mailing list