From 474b917526db60cd113b34f9bbb30e8d252bae24 Mon Sep 17 00:00:00 2001 From: jeff Date: Tue, 23 Jan 2007 08:46:51 +0000 Subject: - Remove setrunqueue and replace it with direct calls to sched_add(). setrunqueue() was mostly empty. The few asserts and thread state setting were moved to the individual schedulers. sched_add() was chosen to displace it for naming consistency reasons. - Remove adjustrunqueue, it was 4 lines of code that was ifdef'd to be different on all three schedulers where it was only called in one place each. - Remove the long ifdef'd out remrunqueue code. - Remove the now redundant ts_state. Inspect the thread state directly. - Don't set TSF_* flags from kern_switch.c, we were only doing this to support a feature in one scheduler. - Change sched_choose() to return a thread rather than a td_sched. Also, rely on the schedulers to return the idlethread. This simplifies the logic in choosethread(). Aside from the run queue links kern_switch.c mostly does not care about the contents of td_sched. Discussed with: julian - Move the idle thread loop into the per scheduler area. ULE wants to do something different from the other schedulers. Suggested by: jhb Tested on: x86/amd64 sched_{4BSD, ULE, CORE}. --- sys/vm/vm_glue.c | 4 ++-- sys/vm/vm_zeroidle.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/vm') diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index ff1d1ff..a3749bf 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -765,9 +765,9 @@ void kick_proc0(void) if (TD_AWAITING_INTR(td)) { - CTR2(KTR_INTR, "%s: setrunqueue %d", __func__, 0); + CTR2(KTR_INTR, "%s: sched_add %d", __func__, 0); TD_CLR_IWAIT(td); - setrunqueue(td, SRQ_INTR); + sched_add(td, SRQ_INTR); } else { proc0_rescan = 1; CTR2(KTR_INTR, "%s: state %d", diff --git a/sys/vm/vm_zeroidle.c b/sys/vm/vm_zeroidle.c index b445003..47ec2b4 100644 --- a/sys/vm/vm_zeroidle.c +++ b/sys/vm/vm_zeroidle.c @@ -181,7 +181,7 @@ pagezero_start(void __unused *arg) td = FIRST_THREAD_IN_PROC(pagezero_proc); sched_class(td, PRI_IDLE); sched_prio(td, PRI_MAX_IDLE); - setrunqueue(td, SRQ_BORING); + sched_add(td, SRQ_BORING); mtx_unlock_spin(&sched_lock); } SYSINIT(pagezero, SI_SUB_KTHREAD_VM, SI_ORDER_ANY, pagezero_start, NULL) -- cgit v1.1