- 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
ab5c14d828
commit
0516c8dd4a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=137067
@ -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