- When choosing a thread on the run queue, check to see if its nice is
outside of the nice threshold due to a recently awoken thread with a lower nice value. This further reduces the amount of time a positively niced thread gets while running in conjunction with a workload that has many short sleeps (ie buildworld).
This commit is contained in:
parent
afe5e0f903
commit
74ec63f7e3
@ -867,8 +867,9 @@ kseq_transfer(struct kseq *kseq, struct kse *ke, int class)
|
||||
static struct kse *
|
||||
kseq_choose(struct kseq *kseq)
|
||||
{
|
||||
struct kse *ke;
|
||||
struct runq *swap;
|
||||
struct kse *ke;
|
||||
int nice;
|
||||
|
||||
mtx_assert(&sched_lock, MA_OWNED);
|
||||
swap = NULL;
|
||||
@ -891,7 +892,8 @@ kseq_choose(struct kseq *kseq)
|
||||
* TIMESHARE kse group and its nice was too far out
|
||||
* of the range that receives slices.
|
||||
*/
|
||||
if (ke->ke_slice == 0) {
|
||||
nice = ke->ke_proc->p_nice + (0 - kseq->ksq_nicemin);
|
||||
if (ke->ke_slice == 0 || nice > SCHED_SLICE_NTHRESH) {
|
||||
runq_remove(ke->ke_runq, ke);
|
||||
sched_slice(ke);
|
||||
ke->ke_runq = kseq->ksq_next;
|
||||
|
Loading…
Reference in New Issue
Block a user