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

[xen master] x86/pmstat: drop struct px_stat's usable field



commit 1048fd331d7b552974735abf1c87d39f41a193b1
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Jul 23 15:24:51 2025 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Jul 23 15:24:51 2025 +0200

    x86/pmstat: drop struct px_stat's usable field
    
    Its initial calculation in cpufreq_statistic_init() is entirely unused,
    as do_get_pm_info() recalculates it before use. That re-calculation can
    then be done right where the output field is set, eliminating the need
    for the internal field. In turn the struct pointer there can then be
    constified.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/drivers/acpi/pmstat.c                 | 7 ++-----
 xen/include/acpi/cpufreq/processor_perf.h | 1 -
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c
index f323ffbe7c..4fae0c14af 100644
--- a/xen/drivers/acpi/pmstat.c
+++ b/xen/drivers/acpi/pmstat.c
@@ -144,7 +144,6 @@ int cpufreq_statistic_init(unsigned int cpu)
     }
 
     pxpt->u.total = count;
-    pxpt->u.usable = count - pmpt->perf.platform_limit;
 
     for ( i = 0; i < count; i++ )
         pxpt->u.pt[i].freq = pmpt->perf.states[i].core_frequency;
@@ -257,7 +256,7 @@ int do_get_pm_info(struct xen_sysctl_get_pmstat *op)
     case PMSTAT_get_pxstat:
     {
         uint32_t ct;
-        struct pm_px *pxpt;
+        const struct pm_px *pxpt;
         spinlock_t *cpufreq_statistic_lock = 
                    &per_cpu(cpufreq_statistic_lock, op->cpuid);
 
@@ -270,8 +269,6 @@ int do_get_pm_info(struct xen_sysctl_get_pmstat *op)
             return -ENODATA;
         }
 
-        pxpt->u.usable = pmpt->perf.state_count - pmpt->perf.platform_limit;
-
         cpufreq_residency_update(op->cpuid, pxpt->u.cur);
 
         /*
@@ -296,7 +293,7 @@ int do_get_pm_info(struct xen_sysctl_get_pmstat *op)
         }
 
         op->u.getpx.total = pxpt->u.total;
-        op->u.getpx.usable = pxpt->u.usable;
+        op->u.getpx.usable = pmpt->perf.state_count - 
pmpt->perf.platform_limit;
         op->u.getpx.last = pxpt->u.last;
         op->u.getpx.cur = pxpt->u.cur;
 
diff --git a/xen/include/acpi/cpufreq/processor_perf.h 
b/xen/include/acpi/cpufreq/processor_perf.h
index caa768626c..4e045da983 100644
--- a/xen/include/acpi/cpufreq/processor_perf.h
+++ b/xen/include/acpi/cpufreq/processor_perf.h
@@ -51,7 +51,6 @@ extern struct processor_pminfo *processor_pminfo[NR_CPUS];
 
 struct px_stat {
     uint8_t total;        /* total Px states */
-    uint8_t usable;       /* usable Px states */
     uint8_t last;         /* last Px state */
     uint8_t cur;          /* current Px state */
     uint64_t *trans_pt;   /* Px transition table */
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

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