From: Ian Campbell Subject: Re: [PATCH v3A 2/3] tools/libxc: allow controlling the max C-state sub-state Date: Fri, 27 Jun 2014 16:26:47 +0100 Message-ID: <1403882807.3169.74.camel@kazak.uk.xensource.com> References: <1403521791-28859-1-git-send-email-ross.lagerwall@citrix.com> <1403521791-28859-3-git-send-email-ross.lagerwall@citrix.com> <53A86754020000780001C80D@mail.emea.novell.com> <1403881323.3169.65.camel@kazak.uk.xensource.com> <53ADA8F2020000780001E187@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53ADA8F2020000780001E187@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Ross Lagerwall , Xen-devel , Ian Jackson , StefanoStabellini List-Id: xen-devel@lists.xenproject.org On Fri, 2014-06-27 at 16:25 +0100, Jan Beulich wrote: > >>> On 27.06.14 at 17:02, wrote: > > On Mon, 2014-06-23 at 16:43 +0100, Jan Beulich wrote: > >> --- a/xen/include/public/sysctl.h > >> +++ b/xen/include/public/sysctl.h > >> @@ -354,7 +354,11 @@ struct xen_sysctl_pm_op { > >> /* set/reset scheduler power saving option */ > >> #define XEN_SYSCTL_pm_op_set_sched_opt_smt 0x21 > >> > >> - /* cpuidle max_cstate access command */ > >> + /* > >> + * cpuidle max C-state and max C-sub-state access command: > >> + * Set cpuid to 0 for max C-state. > >> + * Set cpuid to 1 for max C-sub-state. > > > > This seems pretty nasty. Since the sysctl interface is not fixed can't > > we just turn the existing get/set_max_cstate fields into structs? Or > > (less preferably) define C-sub-states to have bit 31 set. > > > > Can we at least get some named constants instead of 0 and 1? > > Any/all of this would be fine with me; what I suggested was merely > an approach with as little changes as possible for an interface that > wasn't defined/implemented well in the first place. If the interface wasn't well defined/implemented in the first place shouldn't we make it well defined/implemented rather than worry about minimising the changes? Ian.