Re: [PATCH 1/2] nohz: stop updating sleep stats from get_cpu_{idle,iowait}_time_us()

2014-04-15 Thread Peter Zijlstra
On Tue, Apr 15, 2014 at 10:48:54AM +0200, Peter Zijlstra wrote: > On Thu, Apr 10, 2014 at 06:11:03PM +0900, Hidetoshi Seto wrote: > > - if (ts->idle_active) { > > - delta = ktime_sub(now, ts->idle_entrytime); > > - if (nr_iowait_cpu(cpu) > 0) > > -

Re: [PATCH 1/2] nohz: stop updating sleep stats from get_cpu_{idle,iowait}_time_us()

2014-04-15 Thread Peter Zijlstra
On Thu, Apr 10, 2014 at 06:11:03PM +0900, Hidetoshi Seto wrote: > - if (ts->idle_active) { > - delta = ktime_sub(now, ts->idle_entrytime); > - if (nr_iowait_cpu(cpu) > 0) > - ts->iowait_sleeptime = ktime_add(ts->iowait_sleeptime, > delta); > -

Re: [PATCH 1/2] nohz: stop updating sleep stats from get_cpu_{idle,iowait}_time_us()

2014-04-15 Thread Peter Zijlstra
On Thu, Apr 10, 2014 at 06:11:03PM +0900, Hidetoshi Seto wrote: - if (ts-idle_active) { - delta = ktime_sub(now, ts-idle_entrytime); - if (nr_iowait_cpu(cpu) 0) - ts-iowait_sleeptime = ktime_add(ts-iowait_sleeptime, delta); - else

Re: [PATCH 1/2] nohz: stop updating sleep stats from get_cpu_{idle,iowait}_time_us()

2014-04-15 Thread Peter Zijlstra
On Tue, Apr 15, 2014 at 10:48:54AM +0200, Peter Zijlstra wrote: On Thu, Apr 10, 2014 at 06:11:03PM +0900, Hidetoshi Seto wrote: - if (ts-idle_active) { - delta = ktime_sub(now, ts-idle_entrytime); - if (nr_iowait_cpu(cpu) 0) - ts-iowait_sleeptime =

[PATCH 1/2] nohz: stop updating sleep stats from get_cpu_{idle,iowait}_time_us()

2014-04-10 Thread Hidetoshi Seto
It easily cause race because multiple caller can write data without any exclusive locking. To limit the update areas to local, remove update functionality from these functions. Now there is no other way to reach update_ts_time_stats(), fold this static routine into tick_nohz_stop_idle().

[PATCH 1/2] nohz: stop updating sleep stats from get_cpu_{idle,iowait}_time_us()

2014-04-10 Thread Hidetoshi Seto
It easily cause race because multiple caller can write data without any exclusive locking. To limit the update areas to local, remove update functionality from these functions. Now there is no other way to reach update_ts_time_stats(), fold this static routine into tick_nohz_stop_idle().