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

Re: [Xen-devel] [PATCH v2 3/4] tools/libxc: Alow controlling the max C-state sub-state



>>> On 19.06.14 at 13:16, <ross.lagerwall@xxxxxxxxxx> wrote:
> --- a/xen/drivers/acpi/pmstat.c
> +++ b/xen/drivers/acpi/pmstat.c
> @@ -465,13 +465,17 @@ int do_pm_op(struct xen_sysctl_pm_op *op)
>  
>      case XEN_SYSCTL_pm_op_get_max_cstate:
>      {
> -        op->u.get_max_cstate = acpi_get_cstate_limit();
> +        op->u.get_max_cstate = op->cpuid == 0 ?
> +            acpi_get_cstate_limit() : acpi_get_csubstate_limit();
>          break;
>      }
>  
>      case XEN_SYSCTL_pm_op_set_max_cstate:
>      {
> -        acpi_set_cstate_limit(op->u.set_max_cstate);
> +        if ( op->cpuid == 0 )
> +            acpi_set_cstate_limit(op->u.set_max_cstate);
> +        else
> +            acpi_set_csubstate_limit(op->u.set_max_cstate);
>          break;
>      }
>  

Please properly distinguish ->cpuid being zero, one, or anything else
(so that other values can be given a meaning later). Also with 0 and
1 now being valid, I think you need to adjust handling further up in
the function, so that even when running with just a single CPU (which
admittedly should be rare these days) things work correctly. And
finally, I guess you ought to still add a note to the public header
briefly describing the new behavior.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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