All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Han, Huaitong" <huaitong.han@intel.com>
To: "JBeulich@suse.com" <JBeulich@suse.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [V5] x86/cpuidle: get accurate C0 value with xenpm tool
Date: Wed, 20 May 2015 02:42:32 +0000	[thread overview]
Message-ID: <1432089747.3436.9.camel@huaitong-MOBL.ccr.corp.intel.com> (raw)
In-Reply-To: <555B1802020000780007B7FC@mail.emea.novell.com>

On Tue, 2015-05-19 at 10:01 +0100, Jan Beulich wrote:
> >>> On 14.05.15 at 07:23, <huaitong.han@intel.com> wrote:
> > @@ -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[].
res_ticks just is a temp array. I can use a temp variable for
ticks_to_ns  transform, like "tmp=res[i];res[i]=ticks_to_ns(tmp);", and
the array named res[] is better in terms of origin source code.
> Jan
> 

  reply	other threads:[~2015-05-20  2:42 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
2015-05-20  2:42   ` Han, Huaitong [this message]
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=1432089747.3436.9.camel@huaitong-MOBL.ccr.corp.intel.com \
    --to=huaitong.han@intel.com \
    --cc=JBeulich@suse.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.