From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752503AbbJTJbz (ORCPT ); Tue, 20 Oct 2015 05:31:55 -0400 Received: from terminus.zytor.com ([198.137.202.10]:49654 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751857AbbJTJbt (ORCPT ); Tue, 20 Oct 2015 05:31:49 -0400 Date: Tue, 20 Oct 2015 02:31:02 -0700 From: tip-bot for Yuyang Du Message-ID: Cc: hpa@zytor.com, peterz@infradead.org, linux-kernel@vger.kernel.org, dietmar.eggemann@arm.com, tglx@linutronix.de, mingo@kernel.org, torvalds@linux-foundation.org, umgwanakikbuti@gmail.com, yuyang.du@intel.com, efault@gmx.de Reply-To: torvalds@linux-foundation.org, umgwanakikbuti@gmail.com, yuyang.du@intel.com, efault@gmx.de, hpa@zytor.com, peterz@infradead.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@kernel.org, dietmar.eggemann@arm.com In-Reply-To: <1444699103-20272-1-git-send-email-yuyang.du@intel.com> References: <1444699103-20272-1-git-send-email-yuyang.du@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/fair: Fix overly small weight for interactive group entities Git-Commit-ID: fde7d22e01aa0d252fc5c95fa11f0dac35a4dd59 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: fde7d22e01aa0d252fc5c95fa11f0dac35a4dd59 Gitweb: http://git.kernel.org/tip/fde7d22e01aa0d252fc5c95fa11f0dac35a4dd59 Author: Yuyang Du AuthorDate: Tue, 13 Oct 2015 09:18:22 +0800 Committer: Ingo Molnar CommitDate: Tue, 20 Oct 2015 10:13:34 +0200 sched/fair: Fix overly small weight for interactive group entities Commit: 9d89c257dfb9 ("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 Tested-by: Dietmar Eggemann Tested-by: Mike Galbraith Signed-off-by: Yuyang Du Signed-off-by: Peter Zijlstra (Intel) Acked-by: Dietmar Eggemann Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1444699103-20272-1-git-send-email-yuyang.du@intel.com Signed-off-by: Ingo Molnar --- 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 6e2e348..bc62c50 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2363,7 +2363,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; } @@ -2373,7 +2373,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)