Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp1481067rdb; Sat, 23 Dec 2023 08:11:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IG6+078uP+r9m2eVXTeNpkRc2RxXBZ9C+MTLfqLIj7jGR3chVI597eoUbTM0DZVvcExF3ft X-Received: by 2002:a17:902:d2c6:b0:1d3:2e0d:cda3 with SMTP id n6-20020a170902d2c600b001d32e0dcda3mr3684079plc.103.1703347900494; Sat, 23 Dec 2023 08:11:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703347900; cv=none; d=google.com; s=arc-20160816; b=rwKUiku8MRb4/Od4sSlIpiut+M5Dw/53EtHEysiPfbavSvgb1JdRaXt176MdgmUV1m 55EfB/mTNo0I+GRHkC1jYx0uSc4fIwYtVenGvjyxyqDl81H4w07uIVgWAzU9lNrP4Gdl BmMATFc0B/LFzxqZ7/0HsQGrG8FEi6TpBxwS3L7K8qVneb/Ix137O4yXwgAtOwyYCSEB eUQs2RcCEZ0brD5gVsR5KNI7ao+ATzHT98mtqUZhtycT7PjlVMuEsQlUMJ3HzCwWb4NE dMsWIRH3iR1g7tMuXi4Q+/okIaToAdiuF3UI7lIOtBu7BGWLAN5mhEt5cFJf4jtfKEMs cjaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=tqdSeALGoqNstEKfMnT0w2wxKUVJZu18ej/KQGyl3rQ=; fh=N2+10SoQKeHgn78dBOtrg7J0SgehVKXqEPwJ0qVnDMY=; b=Uy1NMZKTbTbAShGuFA2NG36aQb+xA0RY6hYP9ocEeyMd85HSMneRAmWbUGCoSyMX/d vxwZQd9jT3YqH/YbUUapX8oqxcm+tG1Mw085ibvVBHgbWhkUeVYEyQQhv91DcAigLY9u 7VLTD2/aOK5bS7BNHIrg+mvfgT4z+/Dkf60o8nMFUbUQppFj7S5V+7QMNN0NIMWTJv12 RQ47b7hGw1PcvSV+EG8qX9sn3bytA6RxGVWwL+Du7ILMEnpbpFP15wmdHZA4VoXOG5xw 9Gl0CBMIaDk8eITLbK5FaMMu5hYsfrpbtWWpA+mIBgbl2ebEWIrOor1W0AmEqdR2JT2b pvaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=mgv3x6Bg; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel+bounces-10495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10495-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t5-20020a170902e84500b001d42ebf66d3si1880282plg.417.2023.12.23.08.11.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Dec 2023 08:11:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=mgv3x6Bg; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel+bounces-10495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10495-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id F30D0283F5E for ; Sat, 23 Dec 2023 16:11:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CBBF22233A; Sat, 23 Dec 2023 16:10:03 +0000 (UTC) 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" X-Original-To: linux-kernel@vger.kernel.org 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 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: 7bit The following commit has been merged into the sched/core branch of tip: Commit-ID: 599457ba15403037b489fe536266a3d5f9efaed7 Gitweb: https://git.kernel.org/tip/599457ba15403037b489fe536266a3d5f9efaed7 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@linaro.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, arch_set_freq_scale(policy->related_cpus, policy->cur, - policy->cpuinfo.max_freq); + arch_scale_freq_ref(policy->cpu)); spin_lock(&policy->transition_lock); policy->transition_ongoing = false; @@ -2174,7 +2174,7 @@ unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy, policy->cur = 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); 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;