Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3570362rdh; Thu, 28 Sep 2023 16:18:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHlkku7dtfPeuD3lF61Ph9N/Vdy6oJZcfyErJfcUoDkxm3cfGNLjQLwYnvyTLh0V3NYW5Gv X-Received: by 2002:a05:6a20:3247:b0:14c:4deb:7189 with SMTP id hm7-20020a056a20324700b0014c4deb7189mr2526628pzc.26.1695943132949; Thu, 28 Sep 2023 16:18:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695943132; cv=none; d=google.com; s=arc-20160816; b=sAqIZaCZ4ofHpZ3Dqvha+wTRjz86mDqBuXOl8C8MZoFyFIVXag7L8poHtKLuSWsswQ UYw2ZLKqya76kzzJ7nal2r9TsbYRK0pYatw+rVCBQ6+9Y4T/21zgfIR8z/8PrYsEuaLy kt4ZPFf4DP5zoi0MTPcWa28R4YjARjbx1BFjzh1otq1nuljOYe10yxi9taH9V5fI5xDO 8J21MJADr/2urFyUYqufrmg9siwlW/K5V40tP7j1xfzygbsXbgC0cDq3u1QAM2Q9ATu0 I/Vq43u84KSjxLWSoiUjAUI4rfQw8py42xK7/o3z+SjM3x+c4TrRGQ85zrMLIZ691E/p Y05g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ArDC+M/Fj9/rymDfPmXsJ4SDmxJk6crmGXVQHrpZfh4=; fh=rsWP5efm/MCkpaAvJLHch/VXRHcZ2mOg66v/XHlSLLo=; b=zqJW9TL6diVzKnQS6BFhy9w++j2cRza7qe3jHsBV3Spa41IQzO64W/DZyffj25K5Ir EaASlwMnxEsckc2/aUmPxen+UMmUq2ie3OWSwd/9qfKGfrQrGe7YGWYKJcjtikqxXCu0 lDlZnA0BWB2TOm68Z1+lg/78ndWNW0bj47KwkGAxRQvH0kEsPw3ATjvHrJCbScSoajRL Rs21W1HVfM7fxfQkIoxTef4R+pkCUYHzXb8qZPgynTxSVsMmHisUb1jSWIuwcbaf4WZA LkAoIKT/WTuotnjoENrDo45g9EMBV9wQpJj+4motLvAs1d85s7p7ThhSOuehTbG3Tqpw krgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=KxgUIrty; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id q17-20020a17090311d100b001c7269bc9f5si6550657plh.152.2023.09.28.16.18.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 16:18:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=KxgUIrty; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 16D648087255; Thu, 28 Sep 2023 15:05:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230325AbjI1WFK (ORCPT + 99 others); Thu, 28 Sep 2023 18:05:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231542AbjI1WFJ (ORCPT ); Thu, 28 Sep 2023 18:05:09 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FAD219D for ; Thu, 28 Sep 2023 15:05:07 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-405524e6768so114334285e9.2 for ; Thu, 28 Sep 2023 15:05:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20230601.gappssmtp.com; s=20230601; t=1695938706; x=1696543506; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ArDC+M/Fj9/rymDfPmXsJ4SDmxJk6crmGXVQHrpZfh4=; b=KxgUIrtyjEy7/g8YMcZVf/n0F/JCfovtnretUayc4SYLldBYJCbnnCceGqxPW/Miqd 3RNI63iJQc5VimmYYqwCDEsdKQxKVnN/6QANip7pWG00xbep1l+a5N2e9qFIjxFyyYSc 5jsZeISsVmiRHZb7j0a1IHi+GgdGoo3eBeBhxOdiXXu9zRINyzx/RRHKanuIr+wLg/+8 yB/SEiIKcU3AiDB4vnhkSYPcVm+ioXrXqAry3IYMrEv+SiZeZUi4q3YdXco6N5AUaWZu us0LIvUOAmRQTF7EqKvTCF917s0s1fFO7x6+tppraeDlko7B2F1vHskMxYOLsukkOY1J jUFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695938706; x=1696543506; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ArDC+M/Fj9/rymDfPmXsJ4SDmxJk6crmGXVQHrpZfh4=; b=IdK2k/t53IhE8l1eol12XyIlKeiIcgd7pqIIBJYdCcIoeeUDQtEw7W9Z4z02nrReYW KDQKJBYNvuCGk8BRaQco+QxblEFpdStmFJgu+Ob7pSjxO6fEPmEOB7fLrr9uM1Qrvr6T zOrwIT6NfjjTFbppGu441sRPKXM1Garh92RQ5Du4lFUqXgqjqsWjhFsGx5qX4UBz6gG3 LdVL6sfCkFKbrk+htxdy3XBk+GeQbfRPYjA6Kl80U9iDT4VicqJ6qEMLOPLlcodjoVMZ TruHV6iQqfpusKzAsJYIQi1BouMUnCIU8J0tNYTr13f3vhe91+jyfw9tu8HmGdL0CZjR vXwA== X-Gm-Message-State: AOJu0YwUbocPuD00mSH5vzXA+RsUxcbll5JPUwK3Eg61IFt9k1Z9LmSB pKBj/9uQLKjiFMsmHOW5rudTHA== X-Received: by 2002:a05:600c:ad3:b0:402:e68f:888c with SMTP id c19-20020a05600c0ad300b00402e68f888cmr2387507wmr.7.1695938705848; Thu, 28 Sep 2023 15:05:05 -0700 (PDT) Received: from airbuntu (host109-151-228-137.range109-151.btcentralplus.com. [109.151.228.137]) by smtp.gmail.com with ESMTPSA id m5-20020a05600c280500b0040535648639sm74825wmb.36.2023.09.28.15.05.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 15:05:05 -0700 (PDT) Date: Thu, 28 Sep 2023 23:05:04 +0100 From: Qais Yousef To: Vincent Guittot Cc: "Rafael J. Wysocki" , Viresh Kumar , Ingo Molnar , Peter Zijlstra , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Dietmar Eggemann , Lukasz Luba Subject: Re: [PATCH 2/4] sched: cpufreq: Fix apply_dvfs_headroom() escaping uclamp constraints Message-ID: <20230928220504.gcft523kvt5jlfoi@airbuntu> References: <20230829163740.uadhv2jfjuumqk3w@airbuntu> <20230907215555.exjxho34ntkjmn6r@airbuntu> <20230910174638.qe7jqq6mq36brh6o@airbuntu> <20230916192509.bportepj7dbgp6ro@airbuntu> <20230924172301.7lqdcsnpqk7trtno@airbuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Thu, 28 Sep 2023 15:05:23 -0700 (PDT) On 09/28/23 19:50, Vincent Guittot wrote: > > > > Yep, absolutely. It seems we agree that CFS shouldn't go above 800 if it is > > capped even if there's headroom, but the question you have on the way it is > > At least I want to ensure that cpufreq has the right information to make a > smart decision. In the example above, it's not needed to go above 800 for > neither cfs nor irq. Okay you want to do even bigger rework :-) I thought I might have pushed some boundary with the rework I had in mind hehe. > I'm not in favor of showing all details to cpufreq because it will have to > follow the internal changes. In instead, I was thinking of something like: > > /* Function name to be changed */ > unsigned_long effective_cpu_util(int cpu, unsigned int *min, unsigned int *max) > > The function returns the actual utilization of the CPU and some minimum and > maximum limits with the possibility to have the min and/or Actual values > Max > because the min would be a hard minimum value whereas max only a soft maximum > value. > > Min would be the minimum perf to provide to the cpu : typically DL_bw + irq > Actual would be the actual utilization of the cpu: cfs+rt+dl+irq (after scaling > everything in the normal range) > Max would be the maximum needed performance for normal work: typically the > minimum between uclamp and capacity > > Then cpufreq can use these 3 values to compute a performance level and it > will know up to which perf level it should go and if it is worth it. > Something likr: Okay thanks! I think I have better clarity now. Let me try to rework the patches. Cheers -- Qais Yousef