diff options
author | julian <julian@FreeBSD.org> | 2006-12-06 06:34:57 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2006-12-06 06:34:57 +0000 |
commit | 396ed947f6606e1c43668a24471edd3bc2d2303a (patch) | |
tree | c0bf9a3a56052122c3c551fe189b4979f9bf745b /sys/kern/ksched.c | |
parent | a5878e15cf129593dc7e00da508adbbd01fd98f0 (diff) | |
download | FreeBSD-src-396ed947f6606e1c43668a24471edd3bc2d2303a.zip FreeBSD-src-396ed947f6606e1c43668a24471edd3bc2d2303a.tar.gz |
Threading cleanup.. part 2 of several.
Make part of John Birrell's KSE patch permanent..
Specifically, remove:
Any reference of the ksegrp structure. This feature was
never fully utilised and made things overly complicated.
All code in the scheduler that tried to make threaded programs
fair to unthreaded programs. Libpthread processes will already
do this to some extent and libthr processes already disable it.
Also:
Since this makes such a big change to the scheduler(s), take the opportunity
to rename some structures and elements that had to be moved anyhow.
This makes the code a lot more readable.
The ULE scheduler compiles again but I have no idea if it works.
The 4bsd scheduler still reqires a little cleaning and some functions that now do
ALMOST nothing will go away, but I thought I'd do that as a separate commit.
Tested by David Xu, and Dan Eischen using libthr and libpthread.
Diffstat (limited to 'sys/kern/ksched.c')
-rw-r--r-- | sys/kern/ksched.c | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/sys/kern/ksched.c b/sys/kern/ksched.c index 4127367..785c04c 100644 --- a/sys/kern/ksched.c +++ b/sys/kern/ksched.c @@ -105,11 +105,7 @@ getscheduler(struct ksched *ksched, struct thread *td, int *policy) int e = 0; mtx_lock_spin(&sched_lock); -#ifdef KSE - pri_to_rtp(td->td_ksegrp, &rtp); -#else pri_to_rtp(td, &rtp); -#endif mtx_unlock_spin(&sched_lock); switch (rtp.type) { @@ -156,11 +152,7 @@ ksched_getparam(struct ksched *ksched, struct rtprio rtp; mtx_lock_spin(&sched_lock); -#ifdef KSE - pri_to_rtp(td->td_ksegrp, &rtp); -#else pri_to_rtp(td, &rtp); -#endif mtx_unlock_spin(&sched_lock); if (RTP_PRIO_IS_REALTIME(rtp.type)) param->sched_priority = rtpprio_to_p4prio(rtp.prio); @@ -181,9 +173,6 @@ ksched_setscheduler(struct ksched *ksched, { int e = 0; struct rtprio rtp; -#ifdef KSE - struct ksegrp *kg = td->td_ksegrp; -#endif switch(policy) { @@ -198,20 +187,7 @@ ksched_setscheduler(struct ksched *ksched, ? RTP_PRIO_FIFO : RTP_PRIO_REALTIME; mtx_lock_spin(&sched_lock); -#ifdef KSE - rtp_to_pri(&rtp, kg); - FOREACH_THREAD_IN_GROUP(kg, td) { /* XXXKSE */ - if (TD_IS_RUNNING(td)) { - td->td_flags |= TDF_NEEDRESCHED; - } else if (TD_ON_RUNQ(td)) { - if (td->td_priority > kg->kg_user_pri) { - sched_prio(td, kg->kg_user_pri); - } - } - } -#else rtp_to_pri(&rtp, td); -#endif mtx_unlock_spin(&sched_lock); } else @@ -225,28 +201,7 @@ ksched_setscheduler(struct ksched *ksched, rtp.type = RTP_PRIO_NORMAL; rtp.prio = p4prio_to_rtpprio(param->sched_priority); mtx_lock_spin(&sched_lock); -#ifdef KSE - rtp_to_pri(&rtp, kg); - - /* XXX Simply revert to whatever we had for last - * normal scheduler priorities. - * This puts a requirement - * on the scheduling code: You must leave the - * scheduling info alone. - */ - FOREACH_THREAD_IN_GROUP(kg, td) { - if (TD_IS_RUNNING(td)) { - td->td_flags |= TDF_NEEDRESCHED; - } else if (TD_ON_RUNQ(td)) { - if (td->td_priority > kg->kg_user_pri) { - sched_prio(td, kg->kg_user_pri); - } - } - - } -#else rtp_to_pri(&rtp, td); -#endif mtx_unlock_spin(&sched_lock); } break; |