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

From: Peter Zijlstra
Date: Tue Apr 15 2014 - 04:49:39 EST


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
> - ts->idle_sleeptime = ktime_add(ts->idle_sleeptime, delta);
> - ts->idle_entrytime = now;
> - }
> -
> - if (last_update_time)
> - *last_update_time = ktime_to_us(now);
> -
> -}
> -
> -static void tick_nohz_stop_idle(struct tick_sched *ts, ktime_t now)
> -{
> - update_ts_time_stats(smp_processor_id(), ts, now, NULL);
> + /* Updates the per cpu time idle statistics counters */
> + delta = ktime_sub(now, ts->idle_entrytime);
> + if (nr_iowait_cpu(smp_processor_id()) > 0)

Now I know the old code also uses nr_iowait_cpu(), but that function is
crackbrained. This cannot possibly be right.

Anything using nr_iowait_cpu() is broken beyond repair.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/