Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4831479rdb; Tue, 12 Dec 2023 10:22:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IFATDIZ0G0UPmyra0wRhAAYiyTujO91qQ8MR1rf+JyCqT3Y4+THUE+06wb1fTHyKRkcuZwg X-Received: by 2002:a05:6a20:3ca1:b0:190:55ed:c42 with SMTP id b33-20020a056a203ca100b0019055ed0c42mr3993199pzj.63.1702405353412; Tue, 12 Dec 2023 10:22:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702405353; cv=none; d=google.com; s=arc-20160816; b=KOZL8shKkNFe7CZjVgQyrL0EC9+4XbhUL/9GZOG7EVpVkw90z/DG4MLc+0gKEzgjqR avKU3APYCtTazpU1IFbUMGg+etMeOJ4ZVkm264Om673pGJkXhttAjdmaWdHrPhKdJ4Xa xNwrQok5lKpFzl5HE91O3jLILkmmBO3cl/VieI9AEPdW6YvbESkx5E6dgmLLVvTh+DFu LsaYWa6VDFbcvplq8BgE3R/GGbSdE54HXR4wb60ebwfy/EDU/bDPHS6A8QrD9AUsLB6D YbLucNKIDAfwzsVtD7k03hOdj9hW2+yARqdInPYX/65NWH06tJX6Mv3NxkZyFRBsUIkl fS9w== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=VxAiBRdRJ0Dc/58SadFCTDjlm40xKgaOgLhzQKDw3Rc=; fh=GTICJ8TCILp7oz88cNee8E4qHFsFyoqjvFlrwqa//pw=; b=bJ1JNrx3sb0q74u/DS509hGerSvfQhJAfhVyR6lAGupjwOMlU5ThstBjjt84ti92xt 3HvRva9vMkYfpQS886UtEziSNnuUYEgcLn8KJhFaP1N51tKxxh5+jl8ePqajEohnwN82 8kdpQx5Gqhd+TxcIEY6LIcEd5fFMhZMG1C7Iq0/tKZZa8qVyGibFIE3hOb4spYWTNvR9 /SPBV9JCMn7OUgDDHqCvE7VDE9u8SiCcv8ltM47GPb6Df5Okj2G8keNx+FqLWKpuCY5X ljLDC8InBvlkwLvLZZib5E/D5x0kp9HlBcCMDOLKLkPHNa6h/CfQPniK9qj6qyKnKAz5 td/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id j64-20020a638b43000000b005bd11902100si8320607pge.840.2023.12.12.10.22.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 10:22:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id EE2C0806139B; Tue, 12 Dec 2023 10:22:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232745AbjLLSWW (ORCPT + 99 others); Tue, 12 Dec 2023 13:22:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232541AbjLLSWV (ORCPT ); Tue, 12 Dec 2023 13:22:21 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 39BFEA7; Tue, 12 Dec 2023 10:22:28 -0800 (PST) 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 4D329FEC; Tue, 12 Dec 2023 10:23:14 -0800 (PST) Received: from [10.1.35.59] (e133649.arm.com [10.1.35.59]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7F72A3F762; Tue, 12 Dec 2023 10:22:25 -0800 (PST) Message-ID: Date: Tue, 12 Dec 2023 18:22:23 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/4] sched/fair: Be less aggressive in calling cpufreq_update_util() To: Qais Yousef , Dietmar Eggemann Cc: Ingo Molnar , Peter Zijlstra , "Rafael J. Wysocki" , Viresh Kumar , Vincent Guittot , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Lukasz Luba , Wei Wang , Rick Yiu , Chung-Kai Mei References: <20231208015242.385103-1-qyousef@layalina.io> <20231208015242.385103-2-qyousef@layalina.io> <47ef274b-d9cc-4f4f-8134-2dced46005fa@arm.com> <20231212123535.3yns5f4b6awiuesk@airbuntu> Content-Language: en-US From: Hongyan Xia In-Reply-To: <20231212123535.3yns5f4b6awiuesk@airbuntu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 12 Dec 2023 10:22:32 -0800 (PST) On 12/12/2023 12:35, Qais Yousef wrote: > On 12/12/23 11:46, Dietmar Eggemann wrote: >> On 08/12/2023 02:52, Qais Yousef wrote: >>> Due to the way code is structured, it makes a lot of sense to trigger >>> cpufreq_update_util() from update_load_avg(). But this is too aggressive >>> as in most cases we are iterating through entities in a loop to >>> update_load_avg() in the hierarchy. So we end up sending too many >>> request in an loop as we're updating the hierarchy. >> >> But update_load_avg() calls cfs_rq_util_change() which only issues a >> cpufreq_update_util() call for the root cfs_rq? > > Yes I've noticed that and wondered. Maybe my analysis was flawed and I was just > hitting the issue of iowait boost request conflicting with update_load_avg() > request. > > Let me have another look. I think we'll still end up needing to take the update > out of util_avg to be able to combine the two calls. I agree. Currently it does not express the intention clearly. We only want to update the root CFS but the code was written in a misleading way that suggests we want to update for every cfs_rq. A single update at the end looks much nicer and makes other patches easier. Hongyan