From: "Jan Beulich" Subject: Re: [PATCH] x86/mwait_idle: Allow setting the max cstate to C1 Date: Mon, 02 Jun 2014 16:46:54 +0100 Message-ID: <538CB88E0200007800016FC3@mail.emea.novell.com> References: <1401720230-3147-1-git-send-email-ross.lagerwall@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WrURv-0006sN-3C for xen-devel@lists.xenproject.org; Mon, 02 Jun 2014 15:46:59 +0000 In-Reply-To: <1401720230-3147-1-git-send-email-ross.lagerwall@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ross Lagerwall Cc: xen-devel@lists.xenproject.org, Keir Fraser , RossLagerwall List-Id: xen-devel@lists.xenproject.org >>> On 02.06.14 at 16:43, wrote: > From: Ross Lagerwall > > Following 91413b519631 ("x86/mwait_idle: export both C1 and C1E"), when > setting the max cstate to C1, the C1E cstate is used as well. This is > because MWAIT_HINT2CSTATE returns the same value for C1 and C1E. > Instead, when limiting the cstate, compare max_cstate with the position > in the states array, as the acpi cpu_idle driver does. > > Without this patch, there's no way of setting the max cstate to C1 when using > the mwait_idle driver. But it was intentionally this way from the beginning of the existence of the mwait idle driver - the other approach makes the value to be passed really platform dependent (i.e. "max_cstate=2" doesn't universally mean what one would expect: maximum C-state is C2). But I recognize the need to disable all possible (intermediate) levels; I just think this should be done via extending max_cstate= (e.g. by allowing for a second number, which would then indicate the maximum sub-state). Jan