[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 8/9] x86/intel_pstate: support the use of intel_pstate in pmstat.c
On 05/06/2015 15:22, Jan Beulich wrote > >>> "Wang, Wei W" <wei.w.wang@xxxxxxxxx> 06/04/15 4:21 AM >>> > >On 26/05/2015 22:16, Jan Beulich wrote > >> >>> On 13.05.16 at 09:51, <wei.w.wang@xxxxxxxxx> wrote: > >> > --- a/xen/drivers/acpi/pmstat.c > >> > +++ b/xen/drivers/acpi/pmstat.c > >> > @@ -261,29 +272,47 @@ static int get_cpufreq_para(struct > >> xen_sysctl_pm_op *op) > >> > op->u.get_para.cpuinfo_max_freq = policy->cpuinfo.max_freq; > >> > op->u.get_para.cpuinfo_min_freq = policy->cpuinfo.min_freq; > >> > op->u.get_para.scaling_cur_freq = policy->cur; > >> > - op->u.get_para.scaling_max_freq = policy->max; > >> > - op->u.get_para.scaling_min_freq = policy->min; > >> > + if (policy->policy) { > >> > + op->u.get_para.scaling_max.max_perf_pct = policy- > >max_perf_pct; > >> > + op->u.get_para.scaling_min.min_perf_pct = policy->min_perf_pct; > >> > + op->u.get_para.scaling_turbo_pct = policy->turbo_pct; > >> > + } else { > >> > + op->u.get_para.scaling_max.max_freq = policy->max; > >> > + op->u.get_para.scaling_min.min_freq = policy->min; > >> > + } > >> > >> How does the caller then know which of the union member meanings > >> apply? > > > >The end caller is xenpm. It's aware of the running pstate driver, so it > >knows the difference between freq and pct. > > xenpm is one of the possible callers. We don't make hypercalls with just a > single consumer in mind, excluding any other potential one(s). And hence a > hypercall like this should be kind of self contained, i.e. in the case here > the > caller ought to be able to know from its result which of the union fields are > in > use. Ok. It's actually already self-contained. The "scaling_driver" field indicates which union filed the caller should use. This is also how xenpm uses it. Best, Wei _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |