All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ross Lagerwall <ross.lagerwall@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, Keir Fraser <keir@xen.org>
Subject: Re: [PATCH] x86/mwait_idle: Allow setting the max cstate to C1
Date: Wed, 18 Jun 2014 09:13:48 +0100	[thread overview]
Message-ID: <53A14A3C.10001@citrix.com> (raw)
In-Reply-To: <538CB88E0200007800016FC3@mail.emea.novell.com>

On 06/02/2014 04:46 PM, Jan Beulich wrote:
>>>> On 02.06.14 at 16:43, <ross.lagerwall@citrix.com> wrote:
>> From: Ross Lagerwall <rosslagerwall@citrix.com>
>>
>> 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).

Except that is how xenpm and xl debugkeys c already display their 
output. E.g:
C0                   : transition [             3431722]
                        residency  [              131101 ms]
C1                   : transition [                 588]
                        residency  [                3514 ms]
C2                   : transition [                 465]
                        residency  [                 497 ms]
C3                   : transition [                 176]
                        residency  [                 299 ms]
C4                   : transition [                  15]
                        residency  [                   5 ms]
C5                   : transition [             3430478]
                        residency  [            57685073 ms]

In the above, C1 == hardware C1 and C2 == hardware C1E.  Changing it so 
that "xenpm set-max-cstate 1" sets it to xenpm's notion of C1 rather 
than actual C1 (as the patch does) seems consistent to me.

The alternative would be to fix up xenpm, xl debugkeys c, and any other 
consumers of C-states to correctly display substates and take a new 
substate parameter.  IMHO, there's little gain in doing this as C-states 
are really platform dependent anyway.  If the next Intel processor has a 
selectable sub-sub-C-state, do we really want to have to change 
everything again?

Cheers
-- 
Ross Lagerwall

  reply	other threads:[~2014-06-18  8:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-02 14:43 [PATCH] x86/mwait_idle: Allow setting the max cstate to C1 Ross Lagerwall
2014-06-02 15:46 ` Jan Beulich
2014-06-18  8:13   ` Ross Lagerwall [this message]
2014-06-18 10:08     ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53A14A3C.10001@citrix.com \
    --to=ross.lagerwall@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.