Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2163041ybz; Thu, 23 Apr 2020 12:44:04 -0700 (PDT) X-Google-Smtp-Source: APiQypI/7U8mNbKM+KgOFxdaBgrWlIDkwCgHXBKxKbBL0VJUnDgEYc26cKFQKS42Ma4uTS0vGkwF X-Received: by 2002:a05:6402:311c:: with SMTP id dc28mr3956424edb.323.1587671043989; Thu, 23 Apr 2020 12:44:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587671043; cv=none; d=google.com; s=arc-20160816; b=sCYtuJ1RXU8uAsxYSbwqy/NFpGJ2uCgaSMId1V3rC82hAMDJgb7izTudLCL8LqIouN r7RemzEBkKTaSN2b4gWoaXwdG9mit2XxCjdHcUFVxCTE940LT6hy0scDgZYRPNL1xbjr Q8WnX6NHsq2ShAe16rA+G5ozU4wkb9QVD+r/DfLj9OWf7taqsH5cOI4sza53XCv+UM9B w4bQmR6SqD/3uoB85UoFMzE/+CBYwX7/4zWNbjTHvD1GrWB8A2y57mRIIi8JTwAXqa4Q Tud3UWXTSGdKtdYAxIENkGHM36tG3i8cwvGPAQih4X1OVdKXGO6nbB+tVvX2xN4h7N7H KuOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wW7kfjmoIyiH/efnfs36TWPAJN5BAR8J0sx1TkhdOHk=; b=ObMc/nqG7o2W5hKJRJBZTwxjG+0o9euPIARmEchWbWfZ/2vOe1EHOZDoUOax+b6WpF cZNZ6MZTe9rRW08T86iq1CVZViA6dTG+VboZX7h5bX6xV2/puuIW0Q7lRMYHxVTXPs6r miYzUPFP3ytQ4WweT0gEPssi+//kS75GoVhKDF/enGVsCt9olvR57/zF5tHBGCIIY5f9 Ds2R5o78iyJ0DT4QwqVTZJAshhOvnODf5iJHhwkNYu031yUoo+jaufH/2V15v+pocVDp z0u9M30J4WRlkAQbrHmXF+SKDZjuttofdCeZUyR9HzGY2Zo5lsnHa1tqv2IqMjx9BECv EfVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Lshx1wWq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce9si1803938ejb.154.2020.04.23.12.43.40; Thu, 23 Apr 2020 12:44:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Lshx1wWq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728673AbgDWTaE (ORCPT + 99 others); Thu, 23 Apr 2020 15:30:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728652AbgDWTaD (ORCPT ); Thu, 23 Apr 2020 15:30:03 -0400 Received: from merlin.infradead.org (unknown [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60F6DC09B042 for ; Thu, 23 Apr 2020 12:30:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=wW7kfjmoIyiH/efnfs36TWPAJN5BAR8J0sx1TkhdOHk=; b=Lshx1wWqlErHOf6pvnt+vGTshH xPClY/A9iBYc+81Et8Mziz/AVPobzYZKeOjwrZZTmVpyzGhyK6IeW+MquzvpG6npKrQBw0yydLTPP 99NFGcacMwq7LBr4SFD+2tTDCL6sVU0hgvDAVWwGybkNgLv7XO/XpbTaaKGEMJPfxuveNcHJb0jHj DvijphPVp6mvT/6toDkwZw/vFI/H/2KSJCrBJLJTxlH0xiFAxkvpUuS+BfhNTd5ejt+LN4xdwfmmA komegV+nW2BMLeSGZ3sL+g4bPQj/1rtQkQMk3x8XFMMnwN0yKVYUIPcKklz6IQ+1wWwEMP8/SWmmy 4hAh51vQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRhXR-0007Hs-QX; Thu, 23 Apr 2020 19:29:34 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 68F719836F8; Thu, 23 Apr 2020 21:29:30 +0200 (CEST) Date: Thu, 23 Apr 2020 21:29:30 +0200 From: Peter Zijlstra To: Vincent Guittot Cc: mingo@redhat.com, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sched/pelt: sync util/runnable_sum with PELT window when propagating Message-ID: <20200423192930.GY2483@worktop.programming.kicks-ass.net> References: <20200422151401.9147-1-vincent.guittot@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200422151401.9147-1-vincent.guittot@linaro.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 22, 2020 at 05:14:01PM +0200, Vincent Guittot wrote: > update_tg_cfs_util/runnable() propagate the impact of the attach/detach of > an entity down into the cfs_rq hierarchy which must keep the sync with > the current pelt window. > > Even if we can't sync child rq and its group se, we can sync the group se > and parent cfs_rq with current PELT window. In fact, we must keep them sync > in order to stay also synced with others se and group se that are already > attached to the cfs_rq. > > Signed-off-by: Vincent Guittot > --- > kernel/sched/fair.c | 26 ++++++-------------------- > 1 file changed, 6 insertions(+), 20 deletions(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 02f323b85b6d..ca6aa89c88f2 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -3441,52 +3441,38 @@ static inline void > update_tg_cfs_util(struct cfs_rq *cfs_rq, struct sched_entity *se, struct cfs_rq *gcfs_rq) > { > long delta = gcfs_rq->avg.util_avg - se->avg.util_avg; > + u32 divider = LOAD_AVG_MAX - 1024 + cfs_rq->avg.period_contrib; > > /* Nothing to update */ > if (!delta) > return; > > - /* > - * The relation between sum and avg is: > - * > - * LOAD_AVG_MAX - 1024 + sa->period_contrib > - * > - * however, the PELT windows are not aligned between grq and gse. > - */ Instead of deleting this, could we perhaps extend it?