Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3520796pxj; Tue, 1 Jun 2021 07:13:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5wj0Bv8tVkk6kkKgyB6l1RIFpodqovAfeWEZykatIccteeG59/oYga59nLvKEb4ORJTD7 X-Received: by 2002:a02:91c1:: with SMTP id s1mr25559348jag.61.1622556814306; Tue, 01 Jun 2021 07:13:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622556814; cv=none; d=google.com; s=arc-20160816; b=EkeBMwhKgU+++aMIPt/aIyJjPjGJL7By8A/fKl4TheVBLjPIRBOxNwnnwxL6AlQ9pr Ex2UrL1vehKXEXWuugkE+donAKtVYbWnkac/DkOuxuDsWkBPHGfuuPqvRT91JiIIXQra hOQVLetXSoy1m00rQVO7pSeuXriiLUVailcEyuy+RwxELuznAopGftg007CZnMRq7j8F oNK2+Rd4JSBMM23EIYapG/HAw0Y2kJyloDW03p86+nGIrMDmDeG+FXsZwE/GapUFU0WB jTpo7aifZoQunQngXtRdHlN1kFKz06z/977YMHSHuNMBHi+eIZOc+f9HHbj4MgpoYg6q Xwpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=T908x8cZzZ3DYq+TZIGy77hBG4C4i0blq3DVfN+x8fQ=; b=SnBmrm4Pc6sJuGLMjhrs0W9NlYbyD5rmKVJ6MRDKb89fouS4AkJ5mr77gump12PKyr PsAUdHsaI+Voxk2PShYI7ICjf8dG4s5SfHrLMbASJ/qdkNjqL5sAO3herDTyAS8So6w/ CjjFbyl3nprVrv2HbALvA9ukAV8sgKfPX7EfIb40A99oSTE8Xp/rNciHHKAlFerN+0aR ZQqt7mouWOOZb4hY7JZV/NmlPanZkztFp4H5Acqkt0kxxq/2GT12G096b6rKOd2qSWW/ TRFHzh7PtKVJ6+ehrA7StIpvUYT5gDsPiG6bcVhmV07TeOZBCDPvQ51JelfgvG76WpyF gvZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RinfGBRJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h2si9384850ile.35.2021.06.01.07.13.21; Tue, 01 Jun 2021 07:13:34 -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=pass header.i=@linaro.org header.s=google header.b=RinfGBRJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234116AbhFAONX (ORCPT + 99 others); Tue, 1 Jun 2021 10:13:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233871AbhFAONW (ORCPT ); Tue, 1 Jun 2021 10:13:22 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FF6BC061574 for ; Tue, 1 Jun 2021 07:11:41 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id q1so22043127lfo.3 for ; Tue, 01 Jun 2021 07:11:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=T908x8cZzZ3DYq+TZIGy77hBG4C4i0blq3DVfN+x8fQ=; b=RinfGBRJPtALaXeBxqE+Wq0ulbbnpOAs4rsN+O6SS3ba9wq2BRgWVV9eLE+UjduBcf b3T8CxdaEi3+uSRWFaP6UyF98Y2VSpUqJ5R/Cg4MmyS9rSKzG1jaOyFEUMewL6DkG5Dx IQlGX4n57XfJizgLTCc33Bb7Yna++N4ZYm4p0wSo6lu7YbtvgoGQrSuevI/Ma4awC5Ub LCbhOue2Ss8wCo3GoqzyZamotYFcogg9Hu5Kr3GQRqu28sIl2+EU3fj4wbBO3F5pNYdm GUPPAmFqK9w20T3WdA8n4n9c0ZahvhtiTAGarA3peTte6BvRJf5BlF5ao486MjiP7fsK e9Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=T908x8cZzZ3DYq+TZIGy77hBG4C4i0blq3DVfN+x8fQ=; b=dy1UKTTQZmGkVF6/V1isrnlPAXEwJydb2NsxD05Y/MzrRcsrFwoHsUylCDJsjobJg6 QiY9en1QIE/VTw8PMnqDBLLcFMqTGxmcAjTOS4JS/CLcoM1ZjZ1uAeuuZzmDAZImQseg kJGI+yIuQyw6ja4idCGE7Ao5fssaNnWdxZm8SMI/vhL8xWV5hfrJl69ONAO4mvS8ct3v /d0X1L2wqOmWDYCWWnOanzNo2bGcZTuEKQ04EwIf8JzXjOiRUEnp9PpbjLK6irBjtwTa mBOaNwpswZvgngADdqvqXDTF3DtqVk0ABckSCrOVZYSmIQUL9OLfyWrphn9V33wqgnU9 jBsA== X-Gm-Message-State: AOAM532M2Fx5wxssji0pMcqZsshsTcjaNN/QaoQO0JZX5M3PUvAGCAaP 3D492b8qc36n6Tz46mrHcv2WbFSGx2bh9URN0+X/vg== X-Received: by 2002:a05:6512:3483:: with SMTP id v3mr5508265lfr.154.1622556698999; Tue, 01 Jun 2021 07:11:38 -0700 (PDT) MIME-Version: 1.0 References: <20210601083616.804229-1-dietmar.eggemann@arm.com> In-Reply-To: <20210601083616.804229-1-dietmar.eggemann@arm.com> From: Vincent Guittot Date: Tue, 1 Jun 2021 16:11:28 +0200 Message-ID: Subject: Re: [PATCH] sched/fair: Return early from update_tg_cfs_load() if delta == 0 To: Dietmar Eggemann Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 1 Jun 2021 at 10:36, Dietmar Eggemann wrote: > > In case the _avg delta is 0 there is no need to update se's _avg > (level n) nor cfs_rq's _avg (level n-1). These values stay the same. > > Since cfs_rq's _avg isn't changed, i.e. no load is propagated down, > cfs_rq's _sum should stay the same as well. > > So bail out after se's _sum has been updated. > > Signed-off-by: Dietmar Eggemann Reviewed-by: Vincent Guittot > --- > > This patch is against current tip/sched/urgent, commit f268c3737eca > ("tick/nohz: Only check for RCU deferred wakeup on user/guest entry > when needed"). > It needs commit 7c7ad626d9a0 ("sched/fair: Keep load_avg and load_sum > synced"). > > kernel/sched/fair.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index e7c8277e3d54..ce8e0e10e5d4 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -3548,9 +3548,12 @@ update_tg_cfs_load(struct cfs_rq *cfs_rq, struct sched_entity *se, struct cfs_rq > load_sum = (s64)se_weight(se) * runnable_sum; > load_avg = div_s64(load_sum, divider); > > + se->avg.load_sum = runnable_sum; > + > delta = load_avg - se->avg.load_avg; > + if (!delta) > + return; > > - se->avg.load_sum = runnable_sum; > se->avg.load_avg = load_avg; > > add_positive(&cfs_rq->avg.load_avg, delta); > -- > 2.25.1 >