Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2899482rdh; Mon, 30 Oct 2023 10:46:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEsoORJBss9RpMhj4cmRq90jrde9firZ5eJkbZrK9APJQo8T42nY7WCXjvarMK7y82jlXIy X-Received: by 2002:a17:90a:7:b0:27d:7666:d8e9 with SMTP id 7-20020a17090a000700b0027d7666d8e9mr7551039pja.38.1698687968512; Mon, 30 Oct 2023 10:46:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698687968; cv=none; d=google.com; s=arc-20160816; b=s2lt0Xd+P+xEzjZ9ANvgQcgg34oZZGcLWfM2GThs4Y+3ghtsDPiONcytcZBhekr7JI dZG1+rAsBvWFiQOzwZUzUJzNylVzBiHt5VqK+hp7y9C8REetr2N3xteaVOKg+7XiDKaG gaQt8h6nCbEvNNiR1l5r33lv4OGpGfOudecIHPdr2PY6IQYpCeLpKbNh+wDsmHnmhTee 9AyzVnW8lEQknAo8xjogmCqnLZfbKMoirNjh4NpT0nbHLJ+/0GnDo/Yqz0d2r5Y4Ekq7 +wlpLjypCpgV3s+P/IxCcjfxsDqy2rBXJ7FQbLDtDHtIj7CU42Fm8IUVgwcLAL9iI64x cStA== 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=RgUZlj8ELV1P/PCQ7d8s8pgo0fhUMXyRqgd7ATrU3/Y=; fh=UAxrhdjebYPnSrGg0VAS0tn+CyIL3G0BrP0CFRtbypA=; b=iohhtMov1W0x4lBg+itbNem+nyK6fs5Lg4B0PoseJ0VpzkFKweNZflwI4oWsoJSdQE TfXqXB4+g8mBbH5Tjg0lkuO/2TyP7P2xtl12EzYAr6K4SrD2STAowe0pGpMbcjBouots CqJJ04iIFbdNFNrpiCHZcINIKeEL0d09feP2n9Xs/MWHpMIvmOpfKPogARNI78O9rdxV dQVgvEptZWUIUYBdGM1w8BHDDmLrmp0WpMhwZHwxkxKI+dRcSEZ6WZ/00/oOZDXmFGfk 6oQ/vEa3ts2eV6CyWc057xVfTZ1XaZarIgq08bSj3KWjsTdAsu2UNN2SeK1Zl5xcfbVJ E7AA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id ca7-20020a17090af30700b002804113621esi2726423pjb.100.2023.10.30.10.46.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 10:46:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id A0DB08042390; Mon, 30 Oct 2023 10:46:05 -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 S230217AbjJ3Rp7 (ORCPT + 99 others); Mon, 30 Oct 2023 13:45:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229780AbjJ3Rp5 (ORCPT ); Mon, 30 Oct 2023 13:45:57 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CAF7BC4; Mon, 30 Oct 2023 10:45:53 -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 264DAFEC; Mon, 30 Oct 2023 10:46:35 -0700 (PDT) Received: from [10.57.7.2] (unknown [10.57.7.2]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B5B0E3F738; Mon, 30 Oct 2023 10:45:50 -0700 (PDT) Message-ID: <83d6a790-3d18-4922-850b-b60e88761786@arm.com> Date: Mon, 30 Oct 2023 17:46:42 +0000 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 Cc: wyes.karny@amd.com, peterz@infradead.org, linux-pm@vger.kernel.org, rafael@kernel.org, vschneid@redhat.com, bristot@redhat.com, bsegall@google.com, rostedt@goodmis.org, dietmar.eggemann@arm.com, juri.lelli@redhat.com, beata.michalska@arm.com, linux-kernel@vger.kernel.org, qyousef@layalina.io, viresh.kumar@linaro.org, mingo@redhat.com, mgorman@suse.de References: <20231026170913.32605-1-vincent.guittot@linaro.org> <20231026170913.32605-2-vincent.guittot@linaro.org> From: Lukasz Luba In-Reply-To: <20231026170913.32605-2-vincent.guittot@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=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 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]); Mon, 30 Oct 2023 10:46:05 -0700 (PDT) Hi Vincent, On 10/26/23 18:09, Vincent Guittot wrote: > The current method to take into account uclamp hints when estimating the > target frequency can end into situation where the selected target > frequency is finally higher than uclamp hints whereas there are no real > needs. Such cases mainly happen because we are currently mixing the > traditional scheduler utilization signal with the uclamp performance > hints. By adding these 2 metrics, we loose an important information when > it comes to select the target frequency and we have to make some > assumptions which can't fit all cases. > > Rework the interface between the scheduler and schedutil governor in order > to propagate all information down to the cpufreq governor. > > effective_cpu_util() interface changes and now returns the actual > utilization of the CPU with 2 optional inputs: > - The minimum performance for this CPU; typically the capacity to handle > the deadline task and the interrupt pressure. But also uclamp_min > request when available. > - The maximum targeting performance for this CPU which reflects the > maximum level that we would like to not exceed. By default it will be > the CPU capacity but can be reduced because of some performance hints > set with uclamp. The value can be lower than actual utilization and/or > min performance level. You have probably missed my question in the last v1 patch set. The description above needs a bit of clarification, since looking at the patches some dark corners are introduced IMO: Currently, we have a less aggressive power saving policy than this proposal. The questions: What if the PD has 4 CPUs, the max util found is 500 and is from a CPU w/ uclamp_max, but there is another CPU with normal utilization 499? What should be the final frequency for that PD? In current design, where we care more about 'delivered performance to the tasks' than power saving, the +20% would be applied for the frequency. Therefore if that CPU with 499 util doesn't have uclamp_max, it would get a decent amount of idle time for its tasks (to compensate some workload variation). Regards, Lukasz