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

[xen master] x86/pmstat: restore changes lost by "consolidation"



commit e98ec009cdbef2124610dc8afe1c7f73ef6e77eb
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Mon Jun 23 10:49:26 2025 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Jun 23 10:49:26 2025 +0200

    x86/pmstat: restore changes lost by "consolidation"
    
    Both c6e0a5539623 ("cpufreq: use existing local var in
    cpufreq_statistic_init()") and a1ce987411f6 ("cpufreq: don't leave stale
    statistics pointer") were lost in the course of "moving" the code,
    presumably due to overly lax re-basing.
    
    Fixes: bf0cd071db2a ("xen/pmstat: consolidate code into pmstat.c")
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/drivers/acpi/pmstat.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c
index 80dc121e14..e276d55c97 100644
--- a/xen/drivers/acpi/pmstat.c
+++ b/xen/drivers/acpi/pmstat.c
@@ -124,7 +124,6 @@ int cpufreq_statistic_init(unsigned int cpu)
         spin_unlock(cpufreq_statistic_lock);
         return -ENOMEM;
     }
-    per_cpu(cpufreq_statistic_data, cpu) = pxpt;
 
     pxpt->u.trans_pt = xzalloc_array(uint64_t, count * count);
     if ( !pxpt->u.trans_pt )
@@ -143,15 +142,17 @@ int cpufreq_statistic_init(unsigned int cpu)
         return -ENOMEM;
     }
 
-    pxpt->u.total = pmpt->perf.state_count;
-    pxpt->u.usable = pmpt->perf.state_count - pmpt->perf.platform_limit;
+    pxpt->u.total = count;
+    pxpt->u.usable = count - pmpt->perf.platform_limit;
 
-    for ( i = 0; i < pmpt->perf.state_count; i++ )
+    for ( i = 0; i < count; i++ )
         pxpt->u.pt[i].freq = pmpt->perf.states[i].core_frequency;
 
     pxpt->prev_state_wall = NOW();
     pxpt->prev_idle_wall = get_cpu_idle_time(cpu);
 
+    per_cpu(cpufreq_statistic_data, cpu) = pxpt;
+
     spin_unlock(cpufreq_statistic_lock);
 
     return 0;
--
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®.