public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] sched/fair: Fix weight overly small for interactive group entity
@ 2015-10-13  1:18 Yuyang Du
  2015-10-13  1:18 ` [PATCH 2/2] sched/fair: Update task group's load_avg after task migrate Yuyang Du
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Yuyang Du @ 2015-10-13  1:18 UTC (permalink / raw)
  To: peterz, mingo, linux-kernel; +Cc: umgwanakikbuti, Yuyang Du

Commit 9d89c257dfb9c51a532d69 (sched/fair: Rewrite runnable load
and utilization average tracking) led to overly small weight for
interactive group entity. The 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.

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 from especially CPU hogs.

Reported-by: Mike Galbraith <umgwanakikbuti@gmail.com>
Signed-off-by: Yuyang Du <yuyang.du@intel.com>
---
 kernel/sched/fair.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 700eb54..601a253 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2370,7 +2370,7 @@ static inline long calc_tg_weight(struct task_group *tg, struct cfs_rq *cfs_rq)
 	 */
 	tg_weight = atomic_long_read(&tg->load_avg);
 	tg_weight -= cfs_rq->tg_load_avg_contrib;
-	tg_weight += cfs_rq_load_avg(cfs_rq);
+	tg_weight += cfs_rq->load.weight;
 
 	return tg_weight;
 }
@@ -2380,7 +2380,7 @@ static long calc_cfs_shares(struct cfs_rq *cfs_rq, struct task_group *tg)
 	long tg_weight, load, shares;
 
 	tg_weight = calc_tg_weight(tg, cfs_rq);
-	load = cfs_rq_load_avg(cfs_rq);
+	load = cfs_rq->load.weight;
 
 	shares = (tg->shares * load);
 	if (tg_weight)
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-10-20  9:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-13  1:18 [PATCH 1/2] sched/fair: Fix weight overly small for interactive group entity Yuyang Du
2015-10-13  1:18 ` [PATCH 2/2] sched/fair: Update task group's load_avg after task migrate Yuyang Du
2015-10-20  9:31   ` [tip:sched/core] sched/fair: Update task group' s load_avg after task migration tip-bot for Yuyang Du
2015-10-16 14:06 ` [PATCH 1/2] sched/fair: Fix weight overly small for interactive group entity Dietmar Eggemann
2015-10-20  9:31 ` [tip:sched/core] sched/fair: Fix overly small weight for interactive group entities tip-bot for Yuyang Du

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox