Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751567AbbFRC41 (ORCPT ); Wed, 17 Jun 2015 22:56:27 -0400 Received: from mga14.intel.com ([192.55.52.115]:42693 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750762AbbFRC4V (ORCPT ); Wed, 17 Jun 2015 22:56:21 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,636,1427785200"; d="scan'208";a="589973608" Date: Thu, 18 Jun 2015 03:04:02 +0800 From: Yuyang Du To: Boqun Feng Cc: mingo@kernel.org, peterz@infradead.org, linux-kernel@vger.kernel.org, pjt@google.com, bsegall@google.com, morten.rasmussen@arm.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, len.brown@intel.com, rafael.j.wysocki@intel.com, fengguang.wu@intel.com, srikar@linux.vnet.ibm.com Subject: Re: [Resend PATCH v8 0/4] sched: Rewrite runnable load and utilization average tracking Message-ID: <20150617190402.GD1244@intel.com> References: <1434396367-27979-1-git-send-email-yuyang.du@intel.com> <20150617030650.GB5695@fixme-laptop.cn.ibm.com> <20150617051501.GA7154@fixme-laptop.cn.ibm.com> <20150617031101.GC1244@intel.com> <20150617130617.GB7154@fixme-laptop.cn.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150617130617.GB7154@fixme-laptop.cn.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2247 Lines: 63 On Wed, Jun 17, 2015 at 09:06:17PM +0800, Boqun Feng wrote: > > > So the problem is: > > > > 1) The tasks in the workload have too small weight (only 79), because > > they share a task group. > > > > 2) Probably some "high" weight task even runnable a small time > > contribute "big" to cfs_rq's load_avg. > > Thank you for your analysis. > > Some updates: > > I created a task group /g and set /g/cpu.shares to 13312 (1024 * 13), > and then ran `stress --cpu 12` and `dbench 1` simultaneously in that > group. The situation is much better, only one CPU is not fully loaded, > and its utilization rate stays around 85%. > Hi, That is good. You can as well disable autogroup, or "nicer" the autogroup, or exec the dbench from another shell, etc... Thank you for the tests. This may not be intuitive, but actually the results showcased that: 1) the patchset improves the task group share management, accomplishes what it is said to be in terms of fair share, finally. 2) the seamlessly combined runnable + blocked load_avg improves the share of the sometimes runnable sometimes blocked tasks by preserving the blocked load in the avg, fairness is achieved as the dbench has the same weight as the 12 stress tasks, and the dbench (buried in CPU hogging tasks) performance is thus improved. Peter? In addition, to correct the util_avg odd value, the following patch should work. Send it here before I send another version. Thanks, Yuyang diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index a8fd7b9..2b0907c 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -687,7 +687,7 @@ void init_entity_runnable_average(struct sched_entity *se) sa->load_avg = scale_load_down(se->load.weight); sa->load_sum = sa->load_avg * LOAD_AVG_MAX; sa->util_avg = scale_load_down(SCHED_LOAD_SCALE); - sa->util_sum = sa->util_avg * LOAD_AVG_MAX; + sa->util_sum = LOAD_AVG_MAX; /* when this task enqueue'ed, it will contribute to its cfs_rq's load_avg */ } #else -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/