All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Huaitong Han <huaitong.han@intel.com>
Cc: xen-devel@lists.xen.org
Subject: Re: [V5] x86/cpuidle: get accurate C0 value with xenpm tool
Date: Tue, 19 May 2015 10:01:22 +0100	[thread overview]
Message-ID: <555B1802020000780007B7FC@mail.emea.novell.com> (raw)
In-Reply-To: <1431580999-7886-1-git-send-email-huaitong.han@intel.com>

>>> On 14.05.15 at 07:23, <huaitong.han@intel.com> wrote:
> @@ -574,6 +597,7 @@ static void acpi_processor_idle(void)
>              t1 = cpuidle_get_tick();
>              /* Trace cpu idle entry */
>              TRACE_4D(TRC_PM_IDLE_ENTRY, cx->idx, t1, exp, pred);
> +            update_last_cx_stat(power, cx, t1);
>              /* Invoke C2 */
>              acpi_idle_do_entry(cx);
>              /* Get end time (ticks) */
> @@ -602,7 +626,7 @@ static void acpi_processor_idle(void)
>          t1 = cpuidle_get_tick();
>          /* Trace cpu idle entry */
>          TRACE_4D(TRC_PM_IDLE_ENTRY, cx->idx, t1, exp, pred);
> -
> +        update_last_cx_stat(power, cx, t1);
>          /*

Please instead of deleting the blank line here, add another one after
the added line and add ones around the addition in the earlier hunk.

> @@ -1172,7 +1196,10 @@ int pmstat_get_cx_stat(uint32_t cpuid, struct pm_cx_stat *stat)
>  {
>      struct acpi_processor_power *power = processor_powers[cpuid];
>      uint64_t idle_usage = 0, idle_res = 0;
> -    uint64_t usage[ACPI_PROCESSOR_MAX_POWER], res[ACPI_PROCESSOR_MAX_POWER];
> +    uint64_t last_state_update_tick, current_stime, current_tick;
> +    uint64_t usage[ACPI_PROCESSOR_MAX_POWER] = { 0 };
> +    uint64_t res_ticks[ACPI_PROCESSOR_MAX_POWER] = { 0 };
> +    uint64_t res[ACPI_PROCESSOR_MAX_POWER] = { 0 };

Not yet another array on the stack please - I can't see why you
can't get away with just res[].

> --- a/xen/arch/x86/cpu/mwait-idle.c
> +++ b/xen/arch/x86/cpu/mwait-idle.c
> @@ -536,7 +536,6 @@ static void mwait_idle(void)
>  		return;
>  	}
>  
> -	power->last_state = cx;
>  	eax = cx->address;
>  	cstate = ((eax >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK) + 1;
>  
> @@ -554,6 +553,8 @@ static void mwait_idle(void)
>  
>  	before = cpuidle_get_tick();
>  	TRACE_4D(TRC_PM_IDLE_ENTRY, cx->type, before, exp, pred);
> +	/* Now in CX */
> +	update_last_cx_stat(power, cx, before);

Again - blank line ahead of the addition please. Also the comment is
both wrong and (as pointed out before) lacking a stop. Perhaps -
just like in the ACPI driver - just omit it (and fix only the other one a
few lines down)?

Jan

  reply	other threads:[~2015-05-19  9:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14  5:23 [V5] x86/cpuidle: get accurate C0 value with xenpm tool Huaitong Han
2015-05-19  9:01 ` Jan Beulich [this message]
2015-05-20  2:42   ` Han, Huaitong
2015-05-20  8:36     ` Han, Huaitong
2015-05-20 10:07       ` 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=555B1802020000780007B7FC@mail.emea.novell.com \
    --to=jbeulich@suse.com \
    --cc=huaitong.han@intel.com \
    --cc=xen-devel@lists.xen.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.