diff options
author | jeff <jeff@FreeBSD.org> | 2007-01-23 08:46:51 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2007-01-23 08:46:51 +0000 |
commit | 474b917526db60cd113b34f9bbb30e8d252bae24 (patch) | |
tree | b133e2bceeb7a9d12a55f7f5eda206c4edcf51e2 /sys/amd64/linux32 | |
parent | f53a7830f79b8d9247e5d2ae879f0a43c42b49fa (diff) | |
download | FreeBSD-src-474b917526db60cd113b34f9bbb30e8d252bae24.zip FreeBSD-src-474b917526db60cd113b34f9bbb30e8d252bae24.tar.gz |
- 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}.
Diffstat (limited to 'sys/amd64/linux32')
-rw-r--r-- | sys/amd64/linux32/linux32_machdep.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c index dbf32cd..496d592 100644 --- a/sys/amd64/linux32/linux32_machdep.c +++ b/sys/amd64/linux32/linux32_machdep.c @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include <sys/proc.h> #include <sys/resource.h> #include <sys/resourcevar.h> +#include <sys/sched.h> #include <sys/syscallsubr.h> #include <sys/sysproto.h> #include <sys/unistd.h> @@ -480,7 +481,7 @@ linux_fork(struct thread *td, struct linux_fork_args *args) /* make it run */ mtx_lock_spin(&sched_lock); TD_SET_CAN_RUN(td2); - setrunqueue(td2, SRQ_BORING); + sched_add(td2, SRQ_BORING); mtx_unlock_spin(&sched_lock); return (0); @@ -521,7 +522,7 @@ linux_vfork(struct thread *td, struct linux_vfork_args *args) /* make it run */ mtx_lock_spin(&sched_lock); TD_SET_CAN_RUN(td2); - setrunqueue(td2, SRQ_BORING); + sched_add(td2, SRQ_BORING); mtx_unlock_spin(&sched_lock); /* wait for the children to exit, ie. emulate vfork */ @@ -672,7 +673,7 @@ linux_clone(struct thread *td, struct linux_clone_args *args) */ mtx_lock_spin(&sched_lock); TD_SET_CAN_RUN(td2); - setrunqueue(td2, SRQ_BORING); + sched_add(td2, SRQ_BORING); mtx_unlock_spin(&sched_lock); td->td_retval[0] = p2->p_pid; |