Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp333371rdb; Thu, 2 Nov 2023 05:17:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFiekbX4uTwROUfHxI5mIpJgZVRyal9MpU8UUik2etlS8fUToFIIPVCpASKxo/8vcqpA40K X-Received: by 2002:a05:6a21:33a1:b0:177:a131:f31c with SMTP id yy33-20020a056a2133a100b00177a131f31cmr11850985pzb.13.1698927423690; Thu, 02 Nov 2023 05:17:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698927423; cv=none; d=google.com; s=arc-20160816; b=yAlkCw1lYWtT0uXB1ck5i5nqKRPQnROiZ24LLgdatje8Ora0RuY7TzT6FQEX/+G408 ZvlIvqJQQ0/R3YkLZMRW+74DOK8slufk+Nhg8WcWT8timbKOHh6cAevNwBWA3L5maf3H MXWB05XOAZDe/tODh/bByI8y3AKaGDhyWjQp5vB801W9fX1ORNK7MVVLxTaufB1NtM0j xrf2AOPezlY27WVQQkp1mvWjK49zXALbccpPLZvCEXIEBNa71TezhPAZql6oVtAqpKXn 8UIfR0z1adb4i2PTfQtHJQV6IadgkbNvZTZWDkHIVw3htRACkK3XMd8qqoXGJdApx1hX xsiw== 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 :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=bj+imm1D5D65f0ZkSTkChF1Ly0BqYwvKOMMPiuFqI50=; fh=WDIuTRNIUqPiGZcql0XrOLpiPaySTCLPuXSdv872Zgs=; b=wgqYyPJ3DMnlnfFVy5DmDtaQ2DWGY8HUi9sbQb7ci0yhnq5DclFMUdNsSCKzxajZIr 1nvaX1Vwfo3xzNJxSAJUneb0wqT4nLYtWKMI7ue/JwDDTyufV08tQ3VVHSaxluVsC7Lu z+kTxCglsD81o978S5zmxFeKOjs8nrOHKe0TyBp4R+xGtsG5uX2vm8dACGENjv0UjQ6Q oKEKpB0AHTJNguTJbivvTK95OeHQGJVA9hdEQT4xKgjKKnDESXGyVNfYLpfIl+RKvYWy dDE3AbnlhucN3hlnWeDqKSDa3UuiljsodAVNnDEANbCDL84VyH2LJFCdTH5PJMplBafc oc2g== 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 cb5-20020a056a02070500b00579926e0863si1764493pgb.159.2023.11.02.05.17.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 05:17:03 -0700 (PDT) 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 CE8C08217068; Thu, 2 Nov 2023 05:17:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346295AbjKBMQ5 (ORCPT + 99 others); Thu, 2 Nov 2023 08:16:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346548AbjKBMQk (ORCPT ); Thu, 2 Nov 2023 08:16:40 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A17BD198; Thu, 2 Nov 2023 05:03: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 95CEC2F4; Thu, 2 Nov 2023 05:04:18 -0700 (PDT) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 899CC3F67D; Thu, 2 Nov 2023 05:03:33 -0700 (PDT) Message-ID: Date: Thu, 2 Nov 2023 13:03:32 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/2] sched/schedutil: rework performance estimation Content-Language: en-US To: Vincent Guittot , 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 Cc: lukasz.luba@arm.com, wyes.karny@amd.com, beata.michalska@arm.com References: <20231026170913.32605-1-vincent.guittot@linaro.org> <20231026170913.32605-2-vincent.guittot@linaro.org> From: Dietmar Eggemann In-Reply-To: <20231026170913.32605-2-vincent.guittot@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 02 Nov 2023 05:17:02 -0700 (PDT) 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? return max(min, max) is much cleaer. [...]