On 06.03.2025 09:39, Penny Zheng wrote: > Bypass cnstruction and deconstruction for px statistic info( > cpufreq_statistic_init and cpufreq_statistic_exit) in cpufreq > CPPC mode.
You say what you do, but not why. > --- a/xen/drivers/cpufreq/utility.c > +++ b/xen/drivers/cpufreq/utility.c > @@ -98,6 +98,9 @@ int cpufreq_statistic_init(unsigned int cpu) > if ( !pmpt ) > return -EINVAL; > > + if ( !(pmpt->init & XEN_PX_INIT) ) > + return 0; I understand this is needed if statistics really are of no interest for this driver (which needs to be clarified in the description). However, ... > @@ -147,8 +150,12 @@ int cpufreq_statistic_init(unsigned int cpu) > void cpufreq_statistic_exit(unsigned int cpu) > { > struct pm_px *pxpt; > + const struct processor_pminfo *pmpt = processor_pminfo[cpu]; > spinlock_t *cpufreq_statistic_lock = &per_cpu(cpufreq_statistic_lock, > cpu); > > + if ( !(pmpt->init & XEN_PX_INIT) ) > + return; > + > spin_lock(cpufreq_statistic_lock); > > pxpt = per_cpu(cpufreq_statistic_data, cpu); ... why's this needed, when below here there already is: if (!pxpt) { spin_unlock(cpufreq_statistic_lock); return; } ? Jan