Re: [PATCH 2/3] nohz: Synchronize sleep time stats with memory barriers

2014-04-24 Thread Denys Vlasenko
On 04/24/2014 02:16 AM, Frederic Weisbecker wrote: >> + again: >> +active = ACCESS_ONCE(ts->idle_active); >> +smp_rmb(); >> +count = ACCESS_ONCE(ts->idle_sleeptime); >> +if (active == 1) { >> +ktime_t delta, start; >> + >> +smp_rmb(); >> +start =

Re: [PATCH 2/3] nohz: Synchronize sleep time stats with memory barriers

2014-04-23 Thread Frederic Weisbecker
On Wed, Apr 23, 2014 at 09:00:35PM +0200, Denys Vlasenko wrote: > When some call site uses get_cpu_*_time_us() to read a sleeptime > stat, it deduces the total sleeptime by adding the pending time > to the last sleeptime snapshot if the CPU target is idle. > > But this only works if idle_sleeptime

[PATCH 2/3] nohz: Synchronize sleep time stats with memory barriers

2014-04-23 Thread Denys Vlasenko
When some call site uses get_cpu_*_time_us() to read a sleeptime stat, it deduces the total sleeptime by adding the pending time to the last sleeptime snapshot if the CPU target is idle. But this only works if idle_sleeptime, idle_entrytime and idle_active are read and updated under some disciplin