From nobody Sat Dec 27 03:14:15 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 267F614F90; Sat, 23 Dec 2023 16:10:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="mgv3x6Bg"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="3yh3HECF" Date: Sat, 23 Dec 2023 16:09:54 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1703347795; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tqdSeALGoqNstEKfMnT0w2wxKUVJZu18ej/KQGyl3rQ=; b=mgv3x6BgE9KMydjyYhHl3dUSTvG9gxa/D+YA0NQfkGEIebOxEFWeyKszG3uQ4yjYgmW8bp AtWxlL+E5/yXCAl1ygTClk2ujsG1UhBVtDkLyNQAcEgnt131Mnm8A3GKQ6ZptJO/tV5fM8 T8kIEt1mPA85xdPUsIQhg1BtgOiSK+2CxxRH2tqcCJOset+lAB+GxzR/iBLrekxs1yPOUX HxUYesb1b3AYLycXh7LEbV3pnNgkVU7XKLLi1IUBIzZ+1po3z5kqUdXODeyG79tKx7jBL0 NekyHU6iAul/Espyorc1CEMqrUBdaacK1Q5+0ysN30USQ4RPV5J/xxBq7CLWwQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1703347795; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tqdSeALGoqNstEKfMnT0w2wxKUVJZu18ej/KQGyl3rQ=; b=3yh3HECFKSat4LX+Wivedc3aAo5t8DOndTQ/DYtqd1gnUcZst6Zyskvl2KhKYDOeB2tLDD AePqFoIhUs/GhGDg== From: "tip-bot2 for Vincent Guittot" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] cpufreq: Use the fixed and coherent frequency for scaling capacity Cc: Vincent Guittot , Ingo Molnar , Lukasz Luba , Viresh Kumar , "Rafael J. Wysocki" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231211104855.558096-3-vincent.guittot@linaro.org> References: <20231211104855.558096-3-vincent.guittot@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170334779477.398.11717943380884738392.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the sched/core branch of tip: Commit-ID: 599457ba15403037b489fe536266a3d5f9efaed7 Gitweb: https://git.kernel.org/tip/599457ba15403037b489fe536266a3d5f= 9efaed7 Author: Vincent Guittot AuthorDate: Mon, 11 Dec 2023 11:48:50 +01:00 Committer: Ingo Molnar CommitterDate: Sat, 23 Dec 2023 15:52:34 +01:00 cpufreq: Use the fixed and coherent frequency for scaling capacity cpuinfo.max_freq can change at runtime because of boost as an example. This implies that the value could be different from the frequency that has been used to compute the capacity of a CPU. The new arch_scale_freq_ref() returns a fixed and coherent frequency that can be used to compute the capacity for a given frequency. [ Also fix a arch_set_freq_scale() newline style wart in = . ] Signed-off-by: Vincent Guittot Signed-off-by: Ingo Molnar Tested-by: Lukasz Luba Reviewed-by: Lukasz Luba Acked-by: Viresh Kumar Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20231211104855.558096-3-vincent.guittot@lin= aro.org --- drivers/cpufreq/cpufreq.c | 4 ++-- include/linux/cpufreq.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 934d35f..44db4f5 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -454,7 +454,7 @@ void cpufreq_freq_transition_end(struct cpufreq_policy = *policy, =20 arch_set_freq_scale(policy->related_cpus, policy->cur, - policy->cpuinfo.max_freq); + arch_scale_freq_ref(policy->cpu)); =20 spin_lock(&policy->transition_lock); policy->transition_ongoing =3D false; @@ -2174,7 +2174,7 @@ unsigned int cpufreq_driver_fast_switch(struct cpufre= q_policy *policy, =20 policy->cur =3D freq; arch_set_freq_scale(policy->related_cpus, freq, - policy->cpuinfo.max_freq); + arch_scale_freq_ref(policy->cpu)); cpufreq_stats_record_transition(policy, freq); =20 if (trace_cpu_frequency_enabled()) { diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 1c5ca92..afda5f2 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -1203,6 +1203,7 @@ void arch_set_freq_scale(const struct cpumask *cpus, { } #endif + /* the following are really really optional */ extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; extern struct freq_attr cpufreq_freq_attr_scaling_boost_freqs;