lkml.org 
[lkml]   [2012]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] sched: Folding nohz load accounting more accurate
From
Date
On Tue, 2012-06-19 at 14:24 +0800, Charles Wang wrote:
> > +static inline int calc_load_write_idx(void)
> > {
> > + int idx = calc_load_idx;
> > +
> > + /*
> > + * See calc_global_nohz(), if we observe the new index, we also
> > + * need to observe the new update time.
> > + */
> > + smp_rmb();
> > +
> > + /*
> > + * If the folding window started, make sure we start writing in the
> > + * next idle-load delta.
> > + */
> > + if (!time_before(jiffies, calc_load_update))
> > + idx++;
>
> Can we just take calc_load_update as the start time-line here? Will
> there be different ticks between cpus?

I'm not exactly sure what you're asking, but yes and probably yes.

The per-cpu ticks are separate, but on the same time-line. That is, they
don't happen at the exact same moment, either due to per-cpu IRQ
disabling or because the architecture spreads the tick. But they do all
get HZ ticks per second.

Remember, jiffies is a global timeline, and the global calc_load_update
is the last to be moved fwd to the next period, so its ideally suited to
be used to determine the current window.


\
 
 \ /
  Last update: 2012-06-19 12:41    [W:0.133 / U:0.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site