[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [V4] x86/cpuidle: get accurate C0 value with xenpm tool



>>> On 11.05.15 at 16:12, <huaitong.han@xxxxxxxxx> wrote:
> On Mon, 2015-05-11 at 12:10 +0100, Jan Beulich wrote:
>> >>> On 11.05.15 at 11:34, <huaitong.han@xxxxxxxxx> wrote:
>> > @@ -1203,16 +1226,18 @@ int pmstat_get_cx_stat(uint32_t cpuid, struct 
>> > pm_cx_stat *stat)
>> >  
>> >          stat->nr = power->count;
>> >  
>> > +        spin_lock_irq(&power->stat_lock);
>> > +        now = NOW();
>> >          for ( i = 1; i < nr; i++ )
>> >          {
>> > -            spin_lock_irq(&power->stat_lock);
>> >              usage[i] = power->states[i].usage;
>> >              res[i] = tick_to_ns(power->states[i].time);
>> > -            spin_unlock_irq(&power->stat_lock);
>> > -
>> >              idle_usage += usage[i];
>> >              idle_res += res[i];
>> >          }
>> > +        last_state_update_time = 
>> > tick_to_ns(power->last_state_update_tick);
> This "tick_to_ns" still sits in a locked region. for moving out locked
> region, a temp variable named "last_state_update_tick" need be defined,
> the coding style may be not look nice as there is a variable named
> "last_state_update_time".

I don't see the need for yet another variable. If need be, just
rename the existing one to ..._tick.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.