From: "Jan Beulich" <JBeulich@suse.com>
To: Wei W Wang <wei.w.wang@intel.com>
Cc: "andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH v4 10/11] x86/intel_pstate: support the use of intel_pstate in pmstat.c
Date: Wed, 09 Sep 2015 02:31:24 -0600 [thread overview]
Message-ID: <55F00A7C02000078000A1231@prv-mh.provo.novell.com> (raw)
In-Reply-To: <286AC319A985734F985F78AFA26841F7A23F12@shsmsx102.ccr.corp.intel.com>
>>> On 09.09.15 at 10:11, <wei.w.wang@intel.com> wrote:
> On 24/07/2015 22:16, Jan Beulich wrote:
>>>> On 25.06.15 at 13:17, <wei.w.wang@intel.com> wrote:
>> --- a/xen/drivers/acpi/pmstat.c
>> +++ b/xen/drivers/acpi/pmstat.c
>> --- a/xen/include/public/sysctl.h
>> +++ b/xen/include/public/sysctl.h
>> @@ -315,8 +315,18 @@ struct xen_get_cpufreq_para {
>> uint32_t scaling_cur_freq;
>>
>> char scaling_governor[CPUFREQ_NAME_LEN];
>> - uint32_t scaling_max_freq;
>> - uint32_t scaling_min_freq;
>> +
>> + union {
>> + uint32_t freq;
>> + uint32_t pct;
>> + } scaling_max;
>> +
>> + union {
>> + uint32_t freq;
>> + uint32_t pct;
>> + } scaling_min;
>
>>scaling_min and scaling_max should really be of the same type, so that
> someone wanting to introduce helper functions
>>or pointers to them can hand both interchangeably.
>
>>Also I'm starting to get tired of repeating that it is still unclear how a
> consumer of the structure will know which of the
>>two fields of the unions are applicable.
>
> Probably we don't need a union here. I plan to simply change them to
> uint32_t scaling_max_perf;
> uint32_t scaling_max_perf;
>
> Then it's up to the driver to put what kind of value to it. It's like we
> simply provide a drinking vessel, and it depends on the user to put water or
> milk into it. In our case, the intel_pstate driver assigns a percentage vale
> to it (in the "uint32_t" type), and the legacy driver assigns the absolute
> value to it (in the "uint32_t" type, too).
I don't see how this will solve the problem of the consumer not
knowing what kind of value it has to deal with.
Jan
next prev parent reply other threads:[~2015-09-09 8:31 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-25 11:17 [PATCH v4 10/11] x86/intel_pstate: support the use of intel_pstate in pmstat.c Wei Wang
2015-07-24 14:15 ` Jan Beulich
2015-09-09 8:11 ` Wang, Wei W
2015-09-09 8:31 ` Jan Beulich [this message]
2015-09-09 8:49 ` Wang, Wei W
2015-09-09 9:00 ` Jan Beulich
2015-09-09 9:35 ` Wang, Wei W
2015-09-09 10:09 ` Jan Beulich
2015-09-09 10:35 ` Wang, Wei W
2015-09-09 11:57 ` Jan Beulich
2015-09-09 12:56 ` Wang, Wei W
2015-09-09 13:12 ` Jan Beulich
2015-09-09 15:16 ` Wang, Wei W
2015-09-09 15:55 ` Jan Beulich
2015-09-10 5:35 ` Wang, Wei W
2015-09-10 8:16 ` Jan Beulich
2015-09-10 9:33 ` Wang, Wei W
2015-09-10 9:55 ` Jan Beulich
2015-09-10 10:10 ` Wang, Wei W
2015-09-10 10:20 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55F00A7C02000078000A1231@prv-mh.provo.novell.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=wei.w.wang@intel.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).