Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9701580rwp; Thu, 20 Jul 2023 08:32:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlHweFebbxvIJ4X4FD9Ye4D8Pi+fZIBTeqBSJysu3YNPGpCcw7/rVzvoLuFbHWoyVUnTwE0W X-Received: by 2002:a17:906:cc93:b0:993:d75b:63ea with SMTP id oq19-20020a170906cc9300b00993d75b63eamr5107606ejb.16.1689867133569; Thu, 20 Jul 2023 08:32:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689867133; cv=none; d=google.com; s=arc-20160816; b=plTKa5if9C9/PgsFWBbyOzpUq7mFMyjdE6IPl3l5wSnjxoPTNSQbSlYtmoZi6TxC24 pIpVCdKBxrHAR62Wp6AjNRLg2kzCITtDSTzLfrAMDj6CW+z9UYZsTgNT939ERFYOqBvC CQ5D7zEPBCdxeA5VUgsV9EWMH2maf17/T8dfdguU8OweYpgtWLm/HAQIrMNN2eL7Tr1n d1ldsROjccCZIAmiduu5fb8vCVkNeh+IA+Mfug+tmSZC+8FZJDVgTeemwLR8dG18l0Da FHGrZky1QUm9Tr5cUH85Nq3bToQder0Nz6uy/Ij5R8+eVJYukePpK9NY3p0A6XH4PMHo OInQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=PUM2cNEyidkST655B/aZG4d0RTUJotOaukrfXX5O0EY=; fh=RaJQomW6Z3RwDUri8ulyN+eCCmE23v+24r6H3WZI7lA=; b=VgWNo0qmTc3vGt7EhOxmtHr6v0/08mzE3uB1W2/V2e0Lula54PtyGce7tDUYrcm3Tm FjiLfyEf+IAw9jRG5wppkzIxwSZOvwmpBZeUfSNYxf55SgzIeqjDaFZEzoW/BT2by5UW CuF7Y5S+cxsUvrLbdVlR13y58EyghTOVuPOyKJ8uanHRf6zLPQ9M9b144Kwewcw7hC4v lGWRv49mLc8fRBUG0Ia6XHLbad2WQNSyEBVqzPV7TIs9hsQTErbWUojhgxJ2l/oosYjh k5JD91joLAaQzhT9ilqKWRe3o/MxxcTQ52Tp2TYHV3VWXTaS3D6QtK85eLSz2YLxAwOu GZvw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mh20-20020a170906eb9400b00991f5560a1dsi826280ejb.32.2023.07.20.08.31.48; Thu, 20 Jul 2023 08:32:13 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232327AbjGTPWi (ORCPT + 99 others); Thu, 20 Jul 2023 11:22:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230220AbjGTPWh (ORCPT ); Thu, 20 Jul 2023 11:22:37 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9CFB1132 for ; Thu, 20 Jul 2023 08:22:36 -0700 (PDT) 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 6CE9E2F4; Thu, 20 Jul 2023 08:23:19 -0700 (PDT) Received: from [192.168.178.38] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 861C03F738; Thu, 20 Jul 2023 08:22:32 -0700 (PDT) Message-ID: <96efae1a-37f6-c8da-5cdb-07b460307d6b@arm.com> Date: Thu, 20 Jul 2023 17:22:26 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [RFC PATCH 3/4] sched/fair: delay update_tg_load_avg() for cfs_rq's removed load Content-Language: en-US To: Vincent Guittot , Aaron Lu Cc: 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 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> From: Dietmar Eggemann In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,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 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? > > /* > * No need to update load_avg for root_task_group as it is not used. [...]