Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9742014rwp; Thu, 20 Jul 2023 09:04:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlG5JhPFS4T+mQsWtC3CDkjkPzcWPFilsrtRjCWr/zQs3/hPdD9OvoAj51WVPQfp7e8mNW0y X-Received: by 2002:a17:903:228f:b0:1b8:870c:4ce8 with SMTP id b15-20020a170903228f00b001b8870c4ce8mr9058072plh.18.1689869052959; Thu, 20 Jul 2023 09:04:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689869052; cv=none; d=google.com; s=arc-20160816; b=y3d8JDSLxKY0MK3NHWyifd8HKwR2Bzrnfm3sGyj1z7exI7RVfL08Dr3PJDgRYaFt62 j3iMjun3Ns6OC+4U94L0cdYux7FdXnG2XhUmWmc+UqCYMcrJM7LS9Sfas5fBF3vshwwe uatgzxP6k4t/mhljHTc1msVhnpMMUOKjg3dnzHRKirzkz+sCef+LCc0idoSaTGDfR0eL oievOuamK798S5069pAjazFFSqFyjq1NSnL4i6GgPhwOy+s7S4glErtr8qWSN/fS9e14 HKIYklzvTDf4LAr/uJ5JY+reRUBZ1ZEguPpP4Ry6WUB7uV4nLal5uWmtxWWp6fmA6WdA sdtg== 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=j1KRZ58fZO4K0PGPlKCEU4ew+SC12d01sHEHlN/ft4E=; fh=HzqRRotDR85sINH4W2H0HmnDNajAkn0dHjzdtQzZtHE=; b=LdZgAELqbPGCxENtmAJMwvUdc0IYxluo0gFfeGJ/elqPmwr5YJBY1Va4GwkYnHHBc+ 1IHgv7pz7GVtj8DwVTAaXqrFpW5uafL4vYzWQyZTLXWJDiNiIVGVxmVr8ZKzTpGWxVdT c11QDOvTDYshKsOQDLy+7ugYZlPXYaqN8FV9kYvE6fzxoT+aHW+yH/Zbf1Ei4t1Defj9 0KCFMhz42WYodGF2EVQL0eyu9BQO7Ff51RLbdJqyc8qqhX7DrmiR5npsgcP+l4nIrxgr iJaVFeVvZVXWUpkN/XDs9SeUXbuZS5G7dgR55uYLjaAU86EZy722cqBM0iTY5mqKZ0sx oc6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xgZCobKB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k11-20020a170902c40b00b001bb42c27496si1285212plk.233.2023.07.20.09.03.48; Thu, 20 Jul 2023 09:04:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xgZCobKB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232130AbjGTPZX (ORCPT + 99 others); Thu, 20 Jul 2023 11:25:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232039AbjGTPZQ (ORCPT ); Thu, 20 Jul 2023 11:25:16 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF99226B3 for ; Thu, 20 Jul 2023 08:25:07 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4fb863edcb6so1458625e87.0 for ; Thu, 20 Jul 2023 08:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689866706; x=1690471506; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=j1KRZ58fZO4K0PGPlKCEU4ew+SC12d01sHEHlN/ft4E=; b=xgZCobKB5fxteUZockwPQu3aYRlt8w2nv4R7iZLAy4P/QijtNVh3p4TKZq2ta3mxZe MdDJC5cOhzDme/nju0GLqd3ylcbKnHC8O5Z8OBSNcz6/2GVJfiRaPHERjeXthVeueTmO Bb+/60zoKaQZlZDCrVjC6JEGyhBLeHTE4mhrvfG8rhDL9NTsnNKI3OJnGOY8tMq1ck+5 lClf3leNoVD5Ylo4h0216diAxbTfWdZknoZrYZiWX1UzIiHn9X0Z0lciI7qXMGmIU5X6 0/N8YbKoOJRpxWGA8xpgG1NykyKGWugTvwQ4GE2v0XZHfr0bHhRgUZ69+89uwK0i8LfR jA+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689866706; x=1690471506; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=j1KRZ58fZO4K0PGPlKCEU4ew+SC12d01sHEHlN/ft4E=; b=BbWBfhHC8bgzl3IIwI+vUx3Oeb9yX+v3YHA9gqmbg86y4d5WbBCPQikOWPsOVQHQPi Rzac0x7GxOj0RaiZnr/8NTNL+iGhqIo5GHyqeudZhdKNdMggGAV6Dt9lR69RgQzOM6HF ip1ukCBUnvozuZmGvliM8CRAbUVwiwx/2EewEzlv8VSevuEfLXyu1lNKy7H486E+55wm CupA6tV5KLK6EdEGkWlVIonGMT1fxH0oCiYErhqt1VOx19+ILx3Rx+OCLsPc9rJdtLuI CA4wrdMBjpqb00QbCuiulIvYtnY0DpwM+z4na075tKI23VcmYf2wVq0GlB4VoIXeSnd3 NANw== X-Gm-Message-State: ABy/qLbhyKxhQRMGFVMyzPlSxWUIEUTTe4H2tmM2nLMawrUfElI9/Px4 NAYPJQz5wasZn/cKw95GNfFoZlDBpAwqGYVX3hv03w== X-Received: by 2002:ac2:5a59:0:b0:4f8:77f1:299a with SMTP id r25-20020ac25a59000000b004f877f1299amr2568972lfn.42.1689866705738; Thu, 20 Jul 2023 08:25:05 -0700 (PDT) MIME-Version: 1.0 References: <20230718134120.81199-1-aaron.lu@intel.com> <20230718134120.81199-4-aaron.lu@intel.com> <20230719051826.GB84059@ziqianlu-dell> <20230719080105.GA90441@ziqianlu-dell> <20230719132914.GA91858@ziqianlu-dell> <20230720144233.GA185317@ziqianlu-dell> <96efae1a-37f6-c8da-5cdb-07b460307d6b@arm.com> In-Reply-To: <96efae1a-37f6-c8da-5cdb-07b460307d6b@arm.com> From: Vincent Guittot Date: Thu, 20 Jul 2023 17:24:54 +0200 Message-ID: Subject: Re: [RFC PATCH 3/4] sched/fair: delay update_tg_load_avg() for cfs_rq's removed load To: Dietmar Eggemann Cc: Aaron Lu , Peter Zijlstra , Ingo Molnar , Juri Lelli , Daniel Jordan , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Tim Chen , Nitin Tekchandani , Yu Chen , Waiman Long , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 20 Jul 2023 at 17:22, Dietmar Eggemann wrote: > > On 20/07/2023 17:02, Vincent Guittot wrote: > > On Thu, 20 Jul 2023 at 16:42, Aaron Lu wrote: > >> > >> On Thu, Jul 20, 2023 at 03:10:30PM +0200, Vincent Guittot wrote: > >>> On Wed, 19 Jul 2023 at 15:29, Aaron Lu wrote: > >>>> > >>>> On Wed, Jul 19, 2023 at 11:47:06AM +0200, Vincent Guittot wrote: > >>>>> On Wed, 19 Jul 2023 at 10:01, Aaron Lu wrote: > >>>>>> > >>>>>> On Wed, Jul 19, 2023 at 01:18:26PM +0800, Aaron Lu wrote: > > [...] > > > What was wrong with your proposal to limit the update inside > > update_tg_load_avg() ? except maybe s/1000000/NSEC_PER_MSEC/ and > > computing delta after testing the time since last update > > > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > > index a80a73909dc2..e48fd0e6982d 100644 > > --- a/kernel/sched/fair.c > > +++ b/kernel/sched/fair.c > > @@ -3665,6 +3665,7 @@ static inline bool cfs_rq_is_decayed(struct > > cfs_rq *cfs_rq) > > static inline void update_tg_load_avg(struct cfs_rq *cfs_rq) > > { > > long delta = cfs_rq->avg.load_avg - cfs_rq->tg_load_avg_contrib; > > + u64 now = cfs_rq_clock_pelt(cfs_rq); > > Could this be `u64 now = sched_clock_cpu()` like in > migrate_se_pelt_lag() or newidle_balance() to avoid the time morphing > due to PELT's frequency and uArch invariance? yes that's a good point. I missed this > > > > /* > > * No need to update load_avg for root_task_group as it is not used. > > [...] >