From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52703EB64DA for ; Thu, 20 Jul 2023 15:22:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232372AbjGTPWj (ORCPT ); Thu, 20 Jul 2023 11:22:39 -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 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. [...]