Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp909823rwd; Thu, 18 May 2023 05:44:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7CfDgLP/9vszMt2xBHJSgxnU/mskxI0Cz+rduPj8e3u7UMiKdUY3PiIZd1CdmjbW5IBWNu X-Received: by 2002:a17:902:e5c8:b0:1a2:a904:c42e with SMTP id u8-20020a170902e5c800b001a2a904c42emr2157023plf.24.1684413867317; Thu, 18 May 2023 05:44:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684413867; cv=none; d=google.com; s=arc-20160816; b=AUj8gR0MyzFpFlaq+yU4dMgGwblrxNiF2Z798Mu6DgZHHPBNZJikEJ8qbEotfarSbk EgFIFoi9B8ZJ2GfJY72iERrpe1OPf1Bq4lDgZ/e4IyHGHtY0eRxOw0rGsIjhPAyE4j4G wLFJEvF7nFNw4kKIK4EdStrAO+6AqLzDi40/cFl+kW23iaGghRARifMtAntFPfCUZzgP 2dOgUD0crI1c2DPAU6GzjymfX+Ol52+qzfaUHFgSiam6PR1IRQjhsYccj3a94J/+WohN jwdvP215pRNerYkButVNnFihucO3oC4AEKrZVaSQirK0CS4Higi6wqvVP4OYRzfPzW2S bt9w== 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=4H0sVnvXnWMx2NUPH2//8Ju0fHphQl/D0NjTPd/OK24=; b=sZmrIJPJ0u31c8ROkwvf9qa1XpLPiJ40xksjKNMYcQ+3E2VkeVWiOGWRMARVvu4TM9 ekXpyfCzj2jOyGPEhdtG5Egg0xpZtXAo2pZD66wB+cTuTVfOFTwLrhUro7zPIaUlRdab wAx94AyWMrlI1mtRrDROsVuugY7yd6fc+4zYKbAByIqnn7eWm2gbc+1bNyEq59Z2vI24 7Ay14EWFsdPZHJDeNWQ7as9gnVelFms93XxEaGK+BMRDB1lT0YZfNxNqTy9+I0GqRV9E nMmMenD0sVohbzvCgnQoV6QC6Ba6rKsrO519JKoc6O5TXC/cdtB/W7VdgCXthCyFfbSs Z2pg== 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 h20-20020a170902f7d400b0019931c82e24si1187879plw.195.2023.05.18.05.44.14; Thu, 18 May 2023 05:44:27 -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 S230424AbjERMnM (ORCPT + 99 others); Thu, 18 May 2023 08:43:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230031AbjERMnK (ORCPT ); Thu, 18 May 2023 08:43:10 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 886BC1708; Thu, 18 May 2023 05:42:42 -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 CD8951FB; Thu, 18 May 2023 05:43:26 -0700 (PDT) Received: from [10.57.23.99] (unknown [10.57.23.99]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 066533F73F; Thu, 18 May 2023 05:42:40 -0700 (PDT) Message-ID: <8035fedb-820b-2a98-a1af-3a4a8971bcd1@arm.com> Date: Thu, 18 May 2023 13:42:39 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] sched/documentation: elaborate on uclamp limitations To: Qais Yousef Cc: Jonathan Corbet , Vincent Guittot , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar References: <20230505152440.142265-1-hongyan.xia2@arm.com> <20230518113000.pvboekaba7vspjyn@airbuntu> Content-Language: en-US From: Hongyan Xia In-Reply-To: <20230518113000.pvboekaba7vspjyn@airbuntu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,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 Hi Qais, On 2023-05-18 12:30, Qais Yousef wrote: > Please CC sched maintainers (Ingo + Peter) next time as they should pick this > up ultimately and they won't see it from the list only. Will do. I was using the get_maintainers script and I thought that gave me all the CCs. > On 05/05/23 16:24, Hongyan Xia wrote: >> The story in 5.2 about util_avg abruptly jumping from 300 when >> Fmax/Fmin == 3 to 1024 when Fmax/Fmin == 4 hides some details about how >> clock_pelt works behind the scenes. Explicitly mention it to make it >> easier for readers to follow. >> >> Signed-off-by: Hongyan Xia >> Cc: Qais Yousef >> Cc: Vincent Guittot >> --- >> Documentation/scheduler/sched-util-clamp.rst | 17 +++++++++++++++++ >> 1 file changed, 17 insertions(+) >> >> diff --git a/Documentation/scheduler/sched-util-clamp.rst b/Documentation/scheduler/sched-util-clamp.rst >> index 74d5b7c6431d..524df07bceba 100644 >> --- a/Documentation/scheduler/sched-util-clamp.rst >> +++ b/Documentation/scheduler/sched-util-clamp.rst >> @@ -669,6 +669,19 @@ but not proportional to Fmax/Fmin. >> >> p0->util_avg = 300 + small_error >> >> +The reason why util_avg is around 300 even though it runs for 900 at Fmin is: >> +Although running at Fmin reduces the rate of rq_clock_pelt() to 1/3 thus >> +accumulates util_sum at 1/3 of the rate at Fmax, the clock period >> +(rq_clock_pelt() now minus previous rq_clock_pelt()) in: >> + >> +:: >> + >> + util_sum / clock period = util_avg >> + >> +does not shrink to 1/3, since rq->clock_pelt is periodically synchronized with >> +rq->clock_task as long as there's idle time. As a result, we get util_avg of >> +about 300, not 900. >> + > > I feel neutral about these changes. It does answer some questions, but poses > more questions like what is clock_pelt. So we might end up in recursive > regression of explaining the explanation. > > I don't think we have a doc about clock_pelt. Worth adding one and just add > a reference to it from here for those interested in understanding more details > on why we need to go to idle to correct util_avg? I think our code has > explanation, a reference to update_rq_clock_pelt() might suffice too. > > Vincent, do you have an opinion here? Sounds reasonable. I don't mind drafting a doc or just a couple of paragraphs for clock_pelt (or all the different clocks like clock, clock_task, clock_idle_*), if that's what we can agree on. Hongyan