Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp356542rdb; Thu, 2 Nov 2023 05:59:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFTNQzp6TYGFJ7x9I+YGPYQ2TMWqJOJSLMqM550WHUZsUZAffe61qYbHNF7R0IZdjxCUZND X-Received: by 2002:a17:90a:f686:b0:26b:e27:8bc2 with SMTP id cl6-20020a17090af68600b0026b0e278bc2mr17683079pjb.45.1698929980067; Thu, 02 Nov 2023 05:59:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698929980; cv=none; d=google.com; s=arc-20160816; b=deCRurTU7dLGxqdE6bHP3OZQdjbwh3W+ZswXIotS+g+3YWGrVPBZnSkwUEIcy81vNS uUkZ6KeVDQq88u5LD7nPkam+rnVb6aIzqHF+3yaRZNJezgFCejqIf4D5CXe4s0nbTBkA piSp5xjRM+fTT+j+MRI/Mpj+BHu5BykYVNPjT1TVdlyqTlDou/SZ4FNywuZStn/OHoOv wLE9cBw9IXRFKXahmz6wCQr2DQ7dKvNAZwGY2TMZlp23sK8fNaJ+XgCH/tpD7/j8LQea Ka7HS2AyTufC98wtvW4cqrRUUL+PMb0d/wLVJ4xMoZgCKr3kW2w5jiXzmuqMluk8HKfV TOtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=nda+509MTdCcAVWnvqFmQxdRWuc9tM4Iop32+RA3uJI=; fh=tYel6nOO2f3cEWXzb9ATLcqPfsIJsGeweR3YAVHsosI=; b=Y9FZaA97izs4gUgVaP6d1V52g2LEImAxl10hBdtFvKdQmVZkj1MoJAXVVhmZnCgRn9 3QhybxlFnDMpvxudyAUx4qGno7Z/qb2F9r3VQOPdinLBkE72JMzaTKv5YiJSDEzIq/IA zdC0vFuDdPrUm5ANjk9pxTQfOX08qyLiF0TyS7HYGyub822aSakwH+WqWbWhlkAWdAWY dOcmI/CngTp6ZBhPi8CWWWRQ57m/6IcqMMTzhnHWlbFfw7av9jaLC3K7bORJFEQWfhRO VUITATaA/SubKBOb6FOAUFYd7ht9nKOTnAnbrAce2Wr63OZMmyZxK7ick6NSdYpavATr ogzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RmcStXAW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id cm14-20020a17090afa0e00b0027763b64ea1si2723940pjb.44.2023.11.02.05.59.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 05:59:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RmcStXAW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 61D7080F669F; Thu, 2 Nov 2023 05:59:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229607AbjKBM7I (ORCPT + 99 others); Thu, 2 Nov 2023 08:59:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229665AbjKBM7G (ORCPT ); Thu, 2 Nov 2023 08:59:06 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5430F121 for ; Thu, 2 Nov 2023 05:58:58 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6b497c8575aso958570b3a.1 for ; Thu, 02 Nov 2023 05:58:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698929938; x=1699534738; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=nda+509MTdCcAVWnvqFmQxdRWuc9tM4Iop32+RA3uJI=; b=RmcStXAWix7qlknAkqx5yQFYCAJVukqqHWjujWeya71mEuNsb5KxZRSS6wnLFy6QYr OGEfTOjvyjOISMhyd1Qa1nBUrt4q3M6UzSHcvMEjuMEQAG5QS2g1NXJlTetEX22Uh1+q s5q9q/WweykMqTJGu6dsFii1SpCkY32z0d35A5YVXtYcWG8TjSn/YX99GAiUixIb/lhj BN/1ibxP0K7yCzQRmNyQzCoJycAz0Eah6NqwTYzU9JQYzHy+GTf4dVfQ7+SN3hFcnQEP qpY34sqA0E2rw5HUHRf6hhGa5RoXBv9bM2dkSndKvV4NvMXp5b1FKc2sTWQXHUYa1FBJ u1iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698929938; x=1699534738; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nda+509MTdCcAVWnvqFmQxdRWuc9tM4Iop32+RA3uJI=; b=J1rqx/RnChaVkT/vaFt+WU3R5BOK68ivP/GKyjSnyTYG2hmCjgwNuBxx0meLC5Skit 6xsjXCCIh4YHukPjmqIUsNo7YgCyXfhkyxSjQjLfKUmg43jVBKDiJqZ50ewzkhWjJaZZ 6igeO5yGLRvzvbQB8NV/l076tCOrRrzn7/aqMLjtbhsa8Fz6Vp3vlhPDA1vfnlTnxnkb KRGBnyIQ500YOoM6vaoIXvw9AZpzcoFw9rhMYRqyBWEbqBKV5VKvqbg3R460KG4mBvon Ts8GUh24sjgiHyrIwb7WWcH5E4kmPxITA0fODkL4BESysECkBJ2WFpsrPWLiMLTcReeS MkTA== X-Gm-Message-State: AOJu0YzcI5Js32R53XfQKemgFncXsJzF5IoUtnbdSdWdtPb6Yc+zmWBh jhUbVluIZxQETqyuU5IOPsecJcokz4/IcrNA/CRolw== X-Received: by 2002:a05:6a20:7d88:b0:16b:8067:23a7 with SMTP id v8-20020a056a207d8800b0016b806723a7mr23055795pzj.24.1698929937710; Thu, 02 Nov 2023 05:58:57 -0700 (PDT) MIME-Version: 1.0 References: <20231026170913.32605-1-vincent.guittot@linaro.org> <20231026170913.32605-2-vincent.guittot@linaro.org> In-Reply-To: From: Vincent Guittot Date: Thu, 2 Nov 2023 13:58:46 +0100 Message-ID: Subject: Re: [PATCH v2 1/2] sched/schedutil: rework performance estimation To: Dietmar Eggemann Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, rafael@kernel.org, viresh.kumar@linaro.org, qyousef@layalina.io, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, lukasz.luba@arm.com, wyes.karny@amd.com, beata.michalska@arm.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 02 Nov 2023 05:59:34 -0700 (PDT) On Thu, 2 Nov 2023 at 13:03, Dietmar Eggemann wrote: > > On 26/10/2023 19:09, Vincent Guittot wrote: > > [...] > > > @@ -153,14 +152,38 @@ static unsigned int get_next_freq(struct sugov_policy *sg_policy, > > return cpufreq_driver_resolve_freq(policy, freq); > > } > > > > +unsigned long sugov_effective_cpu_perf(int cpu, unsigned long actual, > > + unsigned long min, > > + unsigned long max) > > +{ > > + unsigned long target; > > + struct rq *rq = cpu_rq(cpu); > > + > > + if (rt_rq_is_runnable(&rq->rt)) > > + return max; > > + > > + /* Provide at least enough capacity for DL + IRQ */ > > + target = min; > > + > > + actual = map_util_perf(actual); > > + /* Actually we don't need to target the max performance */ > > + if (actual < max) > > + max = actual; > > + > > + /* > > + * Ensure at least minimum performance while providing more compute > > + * capacity when possible. > > + */ > > + return max(target, max); > > The superfluous `unsigned long target` is still there? Yeah, I forgot to add the change in this version but it's in the next one > > return max(min, max) is much cleaer. > > [...]