8000 sched/fair: Fix overly small weight for interactive group entities · bsd-unix/linux@fde7d22 · GitHub
[go: up one dir, main page]

Skip to content

Commit fde7d22

Browse files
ydu19Ingo Molnar
authored andcommitted
sched/fair: Fix overly small weight for interactive group entities
Commit: 9d89c25 ("sched/fair: Rewrite runnable load and utilization average tracking") led to an overly small weight for interactive group entities. The bad case can be easily reproduced when a number of CPU hogs compete for the CPUs at the same time (thanks to Mike). This is largly because the task group's load average tracking cross CPUs lags behind the real changes. To fix this we accelerate the group share distribution process by using the load.weight of the cfs_rq. This may increase the entire group's share, but we have to do so to protect the (fragile) interactive tasks, especially from CPU hogs. Reported-by: Mike Galbraith <umgwanakikbuti@gmail.com> Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com> Tested-by: Mike Galbraith <umgwanakikbuti@gmail.com> Signed-off-by: Yuyang Du <yuyang.du@intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Dietmar Eggemann <dietmar.eggemann@arm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1444699103-20272-1-git-send-email-yuyang.du@intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 9babcd7 commit fde7d22

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/sched/fair.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2363,7 +2363,7 @@ static inline long calc_tg_weight(struct task_group *tg, struct cfs_rq *cfs_rq)
23632363
*/
23642364
tg_weight = atomic_long_read(&tg->load_avg);
23652365
tg_weight -= cfs_rq->tg_load_avg_contrib;
2366-
tg_weight += cfs_rq_load_avg(cfs_rq);
2366+
tg_weight += cfs_rq->load.weight;
23672367

23682368
return tg_weight;
23692369
}
@@ -2373,7 +2373,7 @@ static long calc_cfs_shares(struct cfs_rq *cfs_rq, struct task_group *tg)
23732373
long tg_weight, load, shares;
23742374

23752375
tg_weight = calc_tg_weight(tg, cfs_rq);
2376-
load = cfs_rq_load_avg(cfs_rq);
2376+
load = cfs_rq->load.weight;
23772377

23782378
shares = (tg->shares * load);
23792379
if (tg_weight)

0 commit comments

Comments
 (0)
0