Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp885311ybd; Wed, 26 Jun 2019 07:36:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzsi9zgpJfK5MHvF2dPiU3SXBupb7HVa3pnsGOpXuQwwpgvT5qN+1rotMIXVvx3OPt/adX X-Received: by 2002:a17:902:2a6b:: with SMTP id i98mr5538405plb.75.1561559785499; Wed, 26 Jun 2019 07:36:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561559785; cv=none; d=google.com; s=arc-20160816; b=SCrBpWc9/l9qae4RfPBcmWDpNjCy8uzcLCdnwDjq8KO6QicAZh5GQT4Yj9GFy8F2Fg OZPNpSHjerjINazmWolS50xRP9MMbUFY2GnvpPF/uRfsohcqe2MYsHjleIGs0XXnVoFo +sd38HlezJanVmVMIsRVFdjNgwuO7bwWzvTwetxWxBKlPU9N4cro6SDL1yCK2N/Bnnsl 0SngzE0ahRClxloOoy+XVAUpWohTYPSwP+DFx0sUY3woPKPdNHS95m931QdP95Q+s1e5 V8UX+5i63TgebdUOs3JrPmTcf1yF2RafBqFYE7SZTq1CfZqrwJ+qNRioqKDflAIav45l nZOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=yatJaFJYjeuKoBiOfW4/DkVWXKxkQlhqxPTf1bNgRC8=; b=IkrVjD3Kz13HDXHtHPA1fDtH1x7rZ90OkTLnTDZmPh2G1bX7FbiscaPNwna9fQK3O4 9qQvIA2B56smw0uAUQuex52GfNbsSuJVxGgqUqeL5QY5YhF7kQ5lpmLh5dnt5KFOHjMt GeJ6Sw26Xpc46oB2qnN1PKLMTrTfFDGI0Ooon6K/WqSkxGIsEAovVNrgxBz/wujROlna fK/KjU5YsoiKx1zAiMFH2msoFVg41IYyD2QmBJaujYwx8hB0aCO2uxDh+ThmzKil0Mw5 Ysi7Ojgjyi+2LwpTajfPJAopDUT0zL5WoByAZV4sBz62fD/eCQ8kd9zYf6DPK+ngIE7Y DD5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f16si2319587pjg.50.2019.06.26.07.36.08; Wed, 26 Jun 2019 07:36:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728008AbfFZOek (ORCPT + 99 others); Wed, 26 Jun 2019 10:34:40 -0400 Received: from foss.arm.com ([217.140.110.172]:34556 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726948AbfFZOek (ORCPT ); Wed, 26 Jun 2019 10:34:40 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id ECD952B; Wed, 26 Jun 2019 07:34:39 -0700 (PDT) Received: from [0.0.0.0] (e107985-lin.cambridge.arm.com [10.1.194.38]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E39D53F706; Wed, 26 Jun 2019 07:34:34 -0700 (PDT) Subject: Re: [PATCH 3/8] sched,fair: redefine runnable_load_avg as the sum of task_h_load To: Rik van Riel , peterz@infradead.org Cc: mingo@redhat.com, linux-kernel@vger.kernel.org, kernel-team@fb.com, morten.rasmussen@arm.com, tglx@linutronix.de, dietmar.eggemann@arm.com, mgorman@techsingularity.com, vincent.guittot@linaro.org References: <20190612193227.993-1-riel@surriel.com> <20190612193227.993-4-riel@surriel.com> From: Dietmar Eggemann Message-ID: <4e50f0a6-92b1-7dfe-884c-d2f7d846cde8@arm.com> Date: Wed, 26 Jun 2019 16:34:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190612193227.993-4-riel@surriel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/12/19 9:32 PM, Rik van Riel wrote: > The runnable_load magic is used to quickly propagate information about > runnable tasks up the hierarchy of runqueues. lhen switching to a flat Looks like here is some information missing. > runqueue, that no longer works. > > Redefine the CPU cfs_rq runnable_load_avg to be the sum of task_h_loads > of the runnable tasks. This provides enough information to the load > balancer. > > The runnable_load_avg of the cgroup cfs_rqs does not appear to be > used for anything, so don't bother calculating those. > > This removes one of the things that the code currently traverses the > cgroup hierarchy for, and getting rid of it brings us one step closer > to a flat runqueue for the CPU controller. > > Signed-off-by: Rik van Riel > --- > include/linux/sched.h | 3 +- > kernel/sched/core.c | 2 - > kernel/sched/debug.c | 1 + > kernel/sched/fair.c | 125 +++++++++++++----------------------------- > kernel/sched/pelt.c | 49 ++++++----------- > kernel/sched/sched.h | 6 -- > 6 files changed, 55 insertions(+), 131 deletions(-) > > diff --git a/include/linux/sched.h b/include/linux/sched.h > index 11837410690f..f5bb6948e40c 100644 > --- a/include/linux/sched.h > +++ b/include/linux/sched.h > @@ -391,7 +391,6 @@ struct util_est { > struct sched_avg { > u64 last_update_time; > u64 load_sum; > - u64 runnable_load_sum; > u32 util_sum; > u32 period_contrib; > unsigned long load_avg; Could you not also remove runnable_load_avg from struct sched_avg and put it into the struct cfs_rq directly. The signal has nothing to to with PELT anymore and se don't have to carry it. You only need it for the root cfs_rq's but it's at least better than having it still for all se's as well. [...] > @@ -2767,20 +2765,39 @@ account_entity_dequeue(struct cfs_rq *cfs_rq, struct sched_entity *se) > static inline void > enqueue_runnable_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se) > { > - cfs_rq->runnable_weight += se->runnable_weight; > + if (entity_is_task(se)) { > + struct cfs_rq *cpu_cfs_rq = &cfs_rq->rq->cfs; There are a couple of comments in fair.c referring to this cfs_rq as the root cfs_rq, rather the cpu cfs_rq. IMHO, easier to read if we stick to one name (root_cfs_rq vs. cpu_cfs_rq). [...]