|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 5/5] tools/libxc: allow controlling the max C-state sub-state
>>> On 10.06.19 at 18:54, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 23/05/2019 13:19, Jan Beulich wrote:
>> From: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
>>
>> Signed-off-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
>>
>> Make handling in do_pm_op() more homogeneous: Before interpreting
>> op->cpuid as such, handle all operations not acting on a particular
>> CPU. Also expose the setting via xenpm.
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>>
>> --- a/tools/libxc/xc_pm.c
>> +++ b/tools/libxc/xc_pm.c
>> @@ -379,7 +379,7 @@ int xc_get_cpuidle_max_cstate(xc_interfa
>> }
>> sysctl.cmd = XEN_SYSCTL_pm_op;
>> sysctl.u.pm_op.cmd = XEN_SYSCTL_pm_op_get_max_cstate;
>> - sysctl.u.pm_op.cpuid = 0;
>> + sysctl.u.pm_op.cpuid = type;
>
> What is type, and why it is being put into a field called cpuid?
Since this isn't code I wrote I'm inclined to say "see the comment
in the public header". Given the pretty special case this is about
I'm not really fancying introducing new structures / fields in
sysctl.h, but judging from your reply you presumably want me to.
>> --- a/tools/misc/xenpm.c
>> +++ b/tools/misc/xenpm.c
>> @@ -1120,13 +1128,17 @@ void get_vcpu_migration_delay_func(int a
>>
>> void set_max_cstate_func(int argc, char *argv[])
>> {
>> - int value;
>> + int value, subval = XEN_SYSCTL_CX_UNLIMITED;
>> char buf[12];
>>
>> - if ( argc != 1 ||
>> + if ( argc < 1 || argc > 2 ||
>> (sscanf(argv[0], "%d", &value) == 1
>> ? value < 0
>> - : (value = XEN_SYSCTL_CX_UNLIMITED, strcmp(argv[0],
>> "unlimited"))) )
>> + : (value = XEN_SYSCTL_CX_UNLIMITED, strcmp(argv[0],
>> "unlimited"))) ||
>> + (argc == 2 &&
>> + (sscanf(argv[1], "%d", &subval) == 1
>> + ? subval < 0
>> + : (subval = XEN_SYSCTL_CX_UNLIMITED, strcmp(argv[1],
>> "unlimited")))) )
>
> Usage update?
Well, yes. That's what I get for picking up other folks' patches.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |