diff options
author | obrien <obrien@FreeBSD.org> | 2004-03-21 18:53:29 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2004-03-21 18:53:29 +0000 |
commit | 7b9a2bdb17478d330cf095c5ed5c3e2aaae76c73 (patch) | |
tree | cfec82f9ea55a4538f23e5bfa349732df6ec237a /sys | |
parent | 97af430ce1feecc017ad5ec7282892633ef0cc62 (diff) | |
download | FreeBSD-src-7b9a2bdb17478d330cf095c5ed5c3e2aaae76c73.zip FreeBSD-src-7b9a2bdb17478d330cf095c5ed5c3e2aaae76c73.tar.gz |
Give a more reasonable CPU time to the threads which are using scheduler
activation (i.e., applications are using libpthread). This is because
SCHED_ULE sometimes puts P_SA processes into ksq_next unnecessarily.
Which doesn't give fair amount of CPU time to processes which are
using scheduler-activation-based threads when other (semi-)CPU-intensive,
non-P_SA processes are running.
Further work will no doubt be done by jeffr at a later date.
Submitted by: Taku YAMAMOTO <taku@cent.saitama-u.ac.jp>
Reviewed by: rwatson, freebsd-current@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/sched_ule.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 52c7991..29be411 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -186,7 +186,7 @@ struct td_sched *thread0_sched = &td_sched; #define SCHED_INTERACTIVE(kg) \ (sched_interact_score(kg) < SCHED_INTERACT_THRESH) #define SCHED_CURR(kg, ke) \ - (ke->ke_thread->td_priority != kg->kg_user_pri || \ + (ke->ke_thread->td_priority < kg->kg_user_pri || \ SCHED_INTERACTIVE(kg)) /* @@ -1166,11 +1166,8 @@ sched_switch(struct thread *td) */ if ((ke->ke_flags & KEF_ASSIGNED) == 0) { if (TD_IS_RUNNING(td)) { - if (td->td_proc->p_flag & P_SA) { - kseq_load_rem(KSEQ_CPU(ke->ke_cpu), ke); - setrunqueue(td); - } else - kseq_runq_add(KSEQ_SELF(), ke); + kseq_load_rem(KSEQ_CPU(ke->ke_cpu), ke); + setrunqueue(td); } else { if (ke->ke_runq) { kseq_load_rem(KSEQ_CPU(ke->ke_cpu), ke); |