Re: [patch 20/39] tick: nohz: Rework next timer evaluation

From: Thomas Gleixner
Date: Tue Apr 21 2015 - 08:04:31 EST


On Thu, 16 Apr 2015, Paul E. McKenney wrote:
> > @@ -1508,11 +1509,12 @@ int rcu_needs_cpu(unsigned long *dj)
> >
> > /* Request timer delay depending on laziness, and round. */
> > if (!rdtp->all_lazy) {
> > - *dj = round_up(rcu_idle_gp_delay + jiffies,
> > + dj = round_up(rcu_idle_gp_delay + jiffies,
> > rcu_idle_gp_delay) - jiffies;
> > } else {
> > - *dj = round_jiffies(rcu_idle_lazy_gp_delay + jiffies) - jiffies;
> > + dj = round_jiffies(rcu_idle_lazy_gp_delay + jiffies) - jiffies;
> > }
> > + *nextevt = basemono + dj * TICK_NSEC;
>
> The multiply would have been a problem back in the day, but should
> be just fine on modern hardware. I suppose that slow hardware could
> compensate by having the scheduling-clock period be an exact power of
> two worth of nanoseconds.

I don't think the extra multiply matters much. round_up() and
round_jiffies() are way more expensive ...

> > #ifdef CONFIG_NO_HZ_FULL
> > + /* Limit the tick delta to the maximum scheduler deferment */
> > if (!ts->inidle)
> > - time_delta = min(time_delta, scheduler_tick_max_deferment());
> > + delta = min(time_delta, scheduler_tick_max_deferment());
>
> s/time_delta/delta/?

Doh, yes.

Btw. Could you please trim your replies? It's hard to find the single
line comment when forced to scroll down several pages.

Thanks,

tglx
--
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/