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

Re: [Xen-devel] [PATCH 4/5] x86: allow limiting the max C-state sub-state



>>> On 10.06.19 at 18:43, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 23/05/2019 13:18, Jan Beulich wrote:
>> From: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
>>
>> Allow limiting the max C-state sub-state by appending to the max_cstate
>> command-line parameter. E.g. max_cstate=1,0
>> The limit only applies to the highest legal C-state. For example:
>>  max_cstate = 1, max_csubstate = 0 ==> C0, C1 okay, but not C1E
>>  max_cstate = 1, max_csubstate = 1 ==> C0, C1 and C1E okay, but not C2
>>  max_cstate = 2, max_csubstate = 0 ==> C0, C1, C1E, C2 okay, but not C3
>>  max_cstate = 2, max_csubstate = 1 ==> C0, C1, C1E, C2 okay, but not C3
>>
>> Signed-off-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> Is this only useful in practice for limiting C1E ?

This may have been the original primary goal, but if you look
at the tables in mwait-idle.c you'll find further sub-states.

>> --- a/xen/arch/x86/acpi/cpu_idle.c
>> +++ b/xen/arch/x86/acpi/cpu_idle.c
>> @@ -104,7 +104,17 @@ bool lapic_timer_init(void)
>>  
>>  void (*__read_mostly pm_idle_save)(void);
>>  unsigned int max_cstate __read_mostly = UINT_MAX;
>> -integer_param("max_cstate", max_cstate);
>> +unsigned int max_csubstate __read_mostly = UINT_MAX;
>> +
>> +static int __init parse_cstate(const char *s)
>> +{
>> +    max_cstate = simple_strtoul(s, &s, 0);
>> +    if ( *s == ',' )
>> +        max_csubstate = simple_strtoul(s + 1, &s, 0);
> 
> You can pass NULL for endp, seeing as it isn't used.

Ah yes.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.