[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/5] cpufreq/hwp: move driver data into policy


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Fri, 23 Jan 2026 17:35:49 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GgmufgnGgUDOr6k/GE5Xoz17xtg6jzpb8FjFlHU/IJ0=; b=Sm3xjO59nJETe31eY/x/I0gVgwfgvR87kYowU280h93ZR39IzWv49Q/0jTEexWa5/8rOiq7htrsYmdRHuOXpF2KVBYY4mKoOywcc+tMhZ7bVb/9fLee2qyBTKXPeKUXRACCHFUvATyFQokd1qssLZp5QJTLceBmbw+LyKtXDbG1H9u1PrMhDy6a+YJnqpFmzkiTTr378qUmvnBFSWIJ3t1drBth71g1iVEOs5Em1frBN84LfcYf1kJY+Hsz9qgPo/ra92BYaYbIaxB6vWKm53vdaYxclfWX97wYQ1vqYAuK5hptosgtMGfyVPQukY8vHKv9fHfJHC3WwpbyPmn/EcA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=e5fLhBonaVAK9O9IrI8jnorQ8wO5MYwkq5E5x06xvM7msH3jTMtI8hUNNyuBsqiuG7YMje/H43ZmCLT0lE9JFqEB+aTzxLSNeltzb7AXm+sbPtZpZfHwn+I8ws+roJjBBekjf5XRGnBQctkaMbbjVvLZlsBLkQOEC3XxJhXf1kdnL7OK1SZg/eLGVcy5f7N+YZfxkg6NDeFh4e+RqaKJJdqyPx+XPctnH+0dJsNx46P38zfTMqPt2sFlr4niKyaPZgX61ssrVGYDIdhms5uCo5MOTjUejkOJpKu6+vYsbXFSM1ppPR0Q4PqKPys7ipkjeOMqZQUITj2xabBhcYxfrg==
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 23 Jan 2026 22:36:06 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2026-01-22 04:42, Jan Beulich wrote:
Share space with the ACPI and powernow drivers, avoiding a separate
allocation for each CPU. Except for get_hwp_para() all use sites already
have the policy available, and this one function can simply be brought
closer to its sibling set_hwp_para().

Minor, but maybe 's/function/function's signature/'. The original phrasing made me think it was code movement.


This then also eliminates the concern over hwp_cpufreq_cpu_init() being
called for all CPUs

We expect hwp_cpufreq_cpu_init() to be called for each CPU, so I am confused by this statement. The data...

>, or a CPU going offline that's recorded in> policy->cpu (which would result in accesses of per-CPU data of offline
CPUs).

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
hwp_cpufreq_target() still requires policy->cpu to be online, though.

--- a/xen/arch/x86/acpi/cpufreq/hwp.c
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c

-static DEFINE_PER_CPU_READ_MOSTLY(struct hwp_drv_data *, hwp_drv_data);

... here is tracked and filled per-CPU.

Do we need cpufreq_add_cpu() to force hw_all = 1 for HWP (and maybe AMD-CPPC) to ensure that policy is allocated per-CPU?

Are we implicitly relying on shared_type == CPUFREQ_SHARED_TYPE_HW to do that for us?

The code here is okay, fwiw.

Thanks,
Jason



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.