From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2302346ADC for ; Fri, 7 Aug 2026 14:33:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786113187; cv=none; b=ZCfBAgwZUnwmOGSCR7e4tkEV2gK4Vqhae2Xdbz1rIw1ssbWVGS5Qw1AsVO50aUAbX1c4Kb7TgSO93RQFrOMM+dATRskF1tbvroJqjwQbeaPFNr3xPNBhCLGsuIXNq19uK0REav66xEN36UJwesRLnVKcIAdFKgpIzjMDX8qO87k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786113187; c=relaxed/simple; bh=0hzL95W0DgdNg01n0jx3iFRTfBCebY5iM8aNdz1ZD10=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Nz0UZSG52RUAsMFMvweImBOIaj5yqUs29XM3Iz9aYY3Q+fHQjuyBaUsCNFaiDXb9sjB6KDLtmVmwAcwjBMYVFfG2XZMzXWGE/XkEq4igt1eel8Uxv4+aSOp83a1c/NPBhSlUBm/fuHflNqY/z9aykoJlsnoaGrvG7s6cCNYnXAw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=m4sUpvH4; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=grM3DTBc; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="m4sUpvH4"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="grM3DTBc" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 677CgJ13989376 for ; Fri, 7 Aug 2026 14:33:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 901SYsPovy4rPKGGIpqTt0xDPadw7CcjZOa24G+R6jA=; b=m4sUpvH4M8auwoYu oi2Wbn4CZO84wqDghNRFiCR9TwpFHws1ctR7KfxDJdEHB33Z5XE/Cmm4bm478BCu 0mdi5CgB7WFCrSKRCmmZP9GHh6y/lzn2S+bIQ/giDWhz8io1IVKJGPt7Bo0Z6CKy TdHicwf+4dqRBqghqRoDUXRpJRbuye7mMv+60Gf5T6+EzNNMmW2/LPOoqTljZgkd ymp1S8s8hBCbiCOKy4sAhUHOkZZ+t4O2PCv5QEmp+z7ch02CEzHNxUZN+neu4WUu qhSPN7zKKRR/yvtIEUfMilz+EohdXoBxpPr1mw/ffZy8YPg9CN3BBGGxtdadlcEn Xe72vA== Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fwctp947r-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 07 Aug 2026 14:33:02 +0000 (GMT) Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-8f08560ea44so37200656d6.1 for ; Fri, 07 Aug 2026 07:33:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786113181; x=1786717981; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=901SYsPovy4rPKGGIpqTt0xDPadw7CcjZOa24G+R6jA=; b=grM3DTBcWSQcTf0sW9BVX1xGzwwDEjLWVJxLhW1J17xZQaCGC75OfAN2U+BofLdtK0 h3ZRBH5nQD2VJQQycqOqbvQww8RRbNv28ScRFDclr4nLPeORcjQ5DszfKApj4NJQYk0j n8Y4FjCnFQGNUGbIJpR0E9g7AlIV55AgWyFzZ8GFQ+VVSRFA1zgtmyXEG4Vyu7K/Iv5I 0U6yXUKwDtL0yokvZYFwU7h2YH5ieim60rVK6NOi+vGDxYeNt5Y/dKl3Nz4oM45xP7Fe tN+19PmWxyCsdOeeph9AxRhZPADvRWLtgSYwiowU4OZdjjGzM8kYWmhpdHOQ3S19Z+xD 3NPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786113181; x=1786717981; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=901SYsPovy4rPKGGIpqTt0xDPadw7CcjZOa24G+R6jA=; b=CSq3myROcEluuNZK7vIowpucvrNcRkUa/tNH0aHAB5mLn1sVLNg9ZoBU5NSfmSUSHW EBTh2V5tm1cAKoRcd2JCTw1+lps2YI5xOxZqaXMvsOrjS125cmZ6XwS53GklUTOqXd9C LXiqY9gg/GNbE/DYYgOrrzdSqSxDqWF1TkWE4KgfpzHjKXgqIgc4Mnl7yUA53vyhNvgJ MYTnrfuGlaRR9Ky6hIVuB8qCOHaKmY0Zjm0MPsd9hzzD3kwqSEwXi2rSV1gkLlyl4zYR kbrUfa9NLs12q+SI5vjJZ1WHd6QxOqk9yN+D2Q8JSegu0Na+DuuqdU54ve3+S67CrXSz 70Lw== X-Forwarded-Encrypted: i=1; AHgh+RrzFgQbFBlE3UEpjOQTKxG1kWK1bu0TGJrKaACCOe0qossOGtYdh4hy87JLz3qLhjolmeYkav749fWWNQg=@vger.kernel.org X-Gm-Message-State: AOJu0Yz/5xW/E+gZaVZlEbfmuGhJKMSDPIkvqP3KetD2DiBeY3UoCQKU sOckcrWuk1G57UHiV1cFEgIUELlSEPulxZxxHgRUIRlT4rmMGJF7sM1rbECusXEpDccGEz/QwAG YfFkvu2w7kNY0n9yid4pARlXn2pvwwhHVKgBwrXrK9Kd5Bj02GcSokKr8hHV1y1Zlx44= X-Gm-Gg: AR+sD11o7UROnEMOjwRH1HPGJT3ztWWtWq9J7Hhv4kVHmiOlp1ZRDT+bxFLk10f14kI PqzLKWqWEw8zPT4D6RnqZiE7YHLOTku131MFQnILijYUMH9TfHMcRPbEYLIrwseeBZCrU1VbQ73 wUNFEobdGbJ7LSISQnqOzlqlm5veJHZ08RjMkM02+PenmvxuefX+5S1iCdsfub7EQ0TFA1PFKSX PTBrwwcD2TIyJS8aBSrQ6/5Jmm0mzvzquFDtKZmcuPnuWDZ8ZThzc1fH4c9B4HGA80uyUfHx3TE ZRxP1VK9pAf3KH+9DdpBKxfyMPGA0E5cc8UEIY0kVRFv/2S9/4b8Fo9ILGLYLMK17VG42ckGm4U KZBa3aqCCUkhTThUVHVAQ9mtQ9rKBA+bCtX+KBzQrEGgo35ZKPs8WA2w839UpSil8Gl8JG+bK/j 5jw0G+777GFPnsJ/5K9w== X-Received: by 2002:a05:6214:48f:b0:8f2:5a3e:c619 with SMTP id 6a1803df08f44-90a345985dfmr7374236d6.4.1786113181499; Fri, 07 Aug 2026 07:33:01 -0700 (PDT) X-Received: by 2002:a05:6214:48f:b0:8f2:5a3e:c619 with SMTP id 6a1803df08f44-90a345985dfmr7372926d6.4.1786113180952; Fri, 07 Aug 2026 07:33:00 -0700 (PDT) Received: from [10.190.200.255] (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-908a92fe515sm9918976d6.24.2026.08.07.07.32.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Aug 2026 07:33:00 -0700 (PDT) Message-ID: Date: Fri, 7 Aug 2026 20:02:52 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] sched/cpufreq: Update schedutil's DVFS request to reach the boost frequencies To: Vincent Guittot Cc: rafael@kernel.org, viresh.kumar@linaro.org, mingo@redhat.com, peterz@infradead.org, linux-arm-msm@vger.kernel.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, linux-kernel@vger.kernel.org, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, kprateek.nayak@amd.com, linux-pm@vger.kernel.org References: <20260806044230.909961-1-sibi.sankar@oss.qualcomm.com> <20260806044230.909961-3-sibi.sankar@oss.qualcomm.com> Content-Language: en-US From: Sibi Sankar In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Authority-Analysis: v=2.4 cv=Fp01OWrq c=1 sm=1 tr=0 ts=6a75ec9e cx=c_pps a=oc9J++0uMp73DTRD5QyR2A==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=gPUjsufZEJvEUY1ZO68A:9 a=QEXdDO2ut3YA:10 a=iYH6xdkBrDN1Jqds4HTS:22 X-Proofpoint-GUID: Azr8gZIAe-UkYSmMUmK9AUzX7NW_U6Xm X-Proofpoint-ORIG-GUID: Azr8gZIAe-UkYSmMUmK9AUzX7NW_U6Xm X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODA3MDExNCBTYWx0ZWRfX/Hqk0J9Xrmbt eb8E4zx18hy+Ft6dIQnaQe6QExPN0pz8CYAZKrTDBKWtVXLxS5pE0mFTq3QYnKeFRJXi8fOU7Tk bv47PWLMA/dwPEufIR61Xmo/+HvXyb8dOJ6qtli6Fty7qhaM8hq52w/iaDjPcac0nBX/eJc1Yav boPe0YN0tHhe/zDqsU1H+CiWYWCkqUWw6jPwiUANcQ9QSslhRmIusugjXFrFi62vTrd25bdDPDx nmvEjMoH2fLDH+nPpa+pfJ7pUiwTE1W/O8fxDB0zJb6KbSLBRkOM5MGwvEgwhIgMPDc/aWkvBZf mWLvYLHqDGomCrZLwc3kFVR9SIUnrK43xAoDJPkEQ19vo8C4+rBnw7CuiA3P8h27JQe3JE4+TBU Xd8HcTl6Pm8/zLfi+RIz003vcRj7768Vse1UdyMc5XisEc0CPDd1UXrvujPjsPtnKjFDywiAF63 h6R10XESzMLtOArYYUg== X-Proofpoint-Spam-Info: AW1haW4tMjYwODA3MDExNCBTYWx0ZWRfX8mYXmbAAN2zO KWiWmQvFXdcPpwRlssLWsQ9G25uOJFNNCjX9Ul1yHLGcL0ivTiOugNhTIsMtLs7MeDPfxHeCzuC 5h25QYZnxfblXvKqEP9TZpKyS5HbxVU= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-07_02,2026-08-06_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 spamscore=0 clxscore=1015 adultscore=0 impostorscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608070114 On 8/6/2026 8:39 PM, Vincent Guittot wrote: > On Thu, 6 Aug 2026 at 06:42, Sibi Sankar wrote: >> capacity_freq_ref, exposed to schedutil via get_capacity_ref_freq(), >> was introduced by commit 9942cb22ea45 ("sched/topology: Add a new >> arch_scale_freq_ref() method") as a fixed anchor that does not move at >> runtime. However, schedutil uses that same fixed anchor as the reference >> plugged into map_util_freq() which saturates exactly at capacity_freq_ref. >> >> As a result, a system with cpufreq boost enabled effectively never runs at >> boost frequencies under schedutil-governed load. Fix this by plugging in >> policy-max into the map_util_freq equation, so that the DVFS requests >> translates to the actual cpufreq driver ceiling. >> >> Signed-off-by: Sibi Sankar >> --- >> kernel/sched/cpufreq_schedutil.c | 13 ++++++++++--- >> 1 file changed, 10 insertions(+), 3 deletions(-) >> >> diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c >> index a1782755efcc..dcefbeaa0702 100644 >> --- a/kernel/sched/cpufreq_schedutil.c >> +++ b/kernel/sched/cpufreq_schedutil.c >> @@ -195,10 +195,17 @@ static unsigned int get_next_freq(struct sugov_policy *sg_policy, >> unsigned long util, unsigned long max) >> { >> struct cpufreq_policy *policy = sg_policy->policy; >> - unsigned int freq; >> + unsigned int freq, ref; >> >> - freq = get_capacity_ref_freq(policy); >> - freq = map_util_freq(util, freq, max); >> + ref = get_capacity_ref_freq(policy); >> + >> + /* >> + * That fixed anchor governs how utilization is interpreted, but >> + * the DVFS request is free to target the current policy ceiling. >> + * Using ref alone would saturate the util->freq map at ref so >> + * use policy->max to reach boost frequencies. >> + */ >> + freq = map_util_freq(util, max(ref, READ_ONCE(policy->max)), max); > But this is wrong because arch_scale_freq_ref is the freq that has > been used when setting the capacity of the cpu and is there to make > sure that the translation between freq <-> capacity is correct and > consistent whatever happens later on the freq table of cpufreq. This > ensures that utilization tracking remains correct vs other CPUS and > prevents or minimizes utilization oscillation, which triggers other > problems > > Either we enable the utilization value to go above CPU's capacity when > we transmit it to cpufreq (and above SCHED_CAPACITY_SCALE which could > trigger a number of problem while computing pelt) > Or, you take into account the boost freq when setting cpu's capacity > and associated capacity_freq_ref at boot even if not enabled. With > cpufreq pressure feature and the policy->max (not cpuinfo_max_freq) > correctly updated with a freq_qos_update_request when boost is > enabled/disabled, the scheduler and pelt should handle that correctly > as we normaly take into account cpufreq_pressure everywhere in > scheduler. Thanks for your inputs! Ack, will try out the latter since it appears to be the right way to address this. > >> if (freq == sg_policy->cached_raw_freq && !sg_policy->need_freq_update) >> return sg_policy->next_freq; >> -- >> 2.34.1 >>