mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
sched/fair: Fix runnable_avg for throttled cfs
When a cfs_rq is throttled, its group entity is dequeued and its running
tasks are removed. We must update runnable_avg with the old h_nr_running
and update group_se->runnable_weight with the new h_nr_running at each
level of the hierarchy.
Reviewed-by: Ben Segall <bsegall@google.com>
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Fixes: 9f68395333
("sched/pelt: Add a new runnable average signal")
Link: https://lkml.kernel.org/r/20200227154115.8332-1-vincent.guittot@linaro.org
This commit is contained in:
parent
ba4f7bc1de
commit
6212437f0f
@ -4720,8 +4720,13 @@ static void throttle_cfs_rq(struct cfs_rq *cfs_rq)
|
||||
if (!se->on_rq)
|
||||
break;
|
||||
|
||||
if (dequeue)
|
||||
if (dequeue) {
|
||||
dequeue_entity(qcfs_rq, se, DEQUEUE_SLEEP);
|
||||
} else {
|
||||
update_load_avg(qcfs_rq, se, 0);
|
||||
se_update_runnable(se);
|
||||
}
|
||||
|
||||
qcfs_rq->h_nr_running -= task_delta;
|
||||
qcfs_rq->idle_h_nr_running -= idle_task_delta;
|
||||
|
||||
@ -4789,8 +4794,13 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq)
|
||||
enqueue = 0;
|
||||
|
||||
cfs_rq = cfs_rq_of(se);
|
||||
if (enqueue)
|
||||
if (enqueue) {
|
||||
enqueue_entity(cfs_rq, se, ENQUEUE_WAKEUP);
|
||||
} else {
|
||||
update_load_avg(cfs_rq, se, 0);
|
||||
se_update_runnable(se);
|
||||
}
|
||||
|
||||
cfs_rq->h_nr_running += task_delta;
|
||||
cfs_rq->idle_h_nr_running += idle_task_delta;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user