From a86157401166d20b4211ade43e621d985dcb903b Mon Sep 17 00:00:00 2001 From: David Xu Date: Thu, 22 Sep 2005 01:19:37 +0000 Subject: [PATCH] Temporarily disable nice threshold detection code, as it can starve a thread holding critical resource, e.g mutex or other implicit synchronous flags. Give thread which exceeds nice threshold a minimum time slice. PR: kern/86087 --- sys/kern/sched_ule.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 1eb302e7111a..e5fe68aafef0 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -886,6 +886,7 @@ kseq_choose(struct kseq *kseq) * of the range that receives slices. */ nice = ke->ke_proc->p_nice + (0 - kseq->ksq_nicemin); +#if 0 if (ke->ke_slice == 0 || (nice > SCHED_SLICE_NTHRESH && ke->ke_proc->p_nice != 0)) { runq_remove(ke->ke_runq, ke); @@ -894,6 +895,7 @@ kseq_choose(struct kseq *kseq) runq_add(ke->ke_runq, ke, 0); continue; } +#endif return (ke); } @@ -1088,7 +1090,7 @@ sched_slice(struct kse *ke) else if (kg->kg_proc->p_nice == 0) ke->ke_slice = SCHED_SLICE_MIN; else - ke->ke_slice = 0; + ke->ke_slice = SCHED_SLICE_MIN; /* 0 */ } else ke->ke_slice = SCHED_SLICE_INTERACTIVE;