From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751474AbdJBRqg (ORCPT ); Mon, 2 Oct 2017 13:46:36 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:39652 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751131AbdJBRqf (ORCPT ); Mon, 2 Oct 2017 13:46:35 -0400 Subject: Re: [PATCH -v2 13/18] sched/fair: Propagate an effective runnable_load_avg To: Peter Zijlstra , mingo@kernel.org, linux-kernel@vger.kernel.org, tj@kernel.org, josef@toxicpanda.com Cc: torvalds@linux-foundation.org, vincent.guittot@linaro.org, efault@gmx.de, pjt@google.com, clm@fb.com, morten.rasmussen@arm.com, bsegall@google.com, yuyang.du@intel.com References: <20170901132059.342024223@infradead.org> <20170901132748.630232806@infradead.org> From: Dietmar Eggemann Message-ID: <9ffc6acc-e0a5-ac01-8c5d-4d71a721fa7f@arm.com> Date: Mon, 2 Oct 2017 18:46:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170901132748.630232806@infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/09/17 14:21, Peter Zijlstra wrote: > The load balancer uses runnable_load_avg as load indicator. For > !cgroup this is: > > runnable_load_avg = \Sum se->avg.load_avg ; where se->on_rq > > That is, a direct sum of all runnable tasks on that runqueue. As > opposed to load_avg, which is a sum of all tasks on the runqueue, > which includes a blocked component. > > However, in the cgroup case, this comes apart since the group entities > are always runnable, even if most of their constituent entities are > blocked. > > Therefore introduce a runnable_weight which for task entities is the > same as the regular weight, but for group entities is a fraction of > the entity weight and represents the runnable part of the group > runqueue. > > Then propagate this load through the PELT hierarchy to arrive at an > effective runnable load avgerage -- which we should not confuse with > the canonical runnable load average. > > Suggested-by: Tejun Heo > Signed-off-by: Peter Zijlstra (Intel) > --- > include/linux/sched.h | 3 > kernel/sched/debug.c | 8 ++ > kernel/sched/fair.c | 173 ++++++++++++++++++++++++++++++++------------------ > kernel/sched/sched.h | 3 > 4 files changed, 125 insertions(+), 62 deletions(-) [...] > @@ -2931,31 +2949,45 @@ static long calc_cfs_shares(struct cfs_r > > static inline int throttled_hierarchy(struct cfs_rq *cfs_rq); > > -static void update_cfs_shares(struct sched_entity *se) > +/* > + * Recomputes the group entity based on the current state of its group > + * runqueue. > + */ > +static void update_cfs_group(struct sched_entity *se) update_cfs_share(s)() is still mentioned in the function header of update_tg_load_avg() and update_cfs_rq_load_avg(). Should we rename those comments with this patch? IMHO, the comment for update_tg_load_avg() is still true whereas the one for update_cfs_rq_load_avg() mentions cfs_rq->avg as cfs_rq->avg.load_avg (or cfs_rq_load_avg()) and update_cfs_group() doesn't use it anymore. It's now used in calc_group_runnable() and calc_group_shares() instead. [...]