Re: [PATCH 1/2] timer: Avoid waking up an idle-core by migrate running timer

From: Thomas Gleixner
Date: Tue Apr 21 2015 - 17:32:21 EST


On Fri, 17 Apr 2015, viresh kumar wrote:
> Does this look any better ?

Yes, but:

> 1.) Should the above list_empty(migration_list) block be added out of the
>
> while (time_after_eq(jiffies, base->timer_jiffies))
>
> block ? So that we check it only once per timer interrupt.

That's what I suggested.

> Also ->running_timer is set to the last serviced timer and a
> del_timer_sync() might be waiting to remove it. But we continue with
> the migration list first, without clearing it first. Not sure if this
> is important at all..

Of course it is and doing it outside of the loop solves that issue.

> 2.) By the time we finish serving all pending timers, local CPU might not be
> idle anymore OR the target CPU may become idle.

That's another good reason to move that migration list outside of the
while loop.

> 2.) It might be better to update preferred_target every time we choose a
> difference base. This may help us avoid calling get_nohz_timer_target()
> in the second if block above.

Yuck no. You can do that in that migration code and not add more
pointless crap to the normal case.

Are you realizing that __mod_timer() is a massive hotpath for network
heavy workloads?

This stuff needs to be debloated and not mindlessly packed with more
corner case features.

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/