Re: [PATCH v4 14/16] timer: Implement the hierarchical pull model

From: Frederic Weisbecker
Date: Wed Nov 09 2022 - 11:40:43 EST


On Fri, Nov 04, 2022 at 03:57:35PM +0100, Anna-Maria Behnsen wrote:
> diff --git a/kernel/time/timer.c b/kernel/time/timer.c
> index f8b2065df79b..214397d84747 100644
> --- a/kernel/time/timer.c
> +++ b/kernel/time/timer.c
> @@ -53,6 +53,7 @@
> #include <asm/io.h>
>
> #include "tick-internal.h"
> +#include "timer_migration.h"
>
> #define CREATE_TRACE_POINTS
> #include <trace/events/timer.h>
> @@ -592,10 +593,13 @@ trigger_dyntick_cpu(struct timer_base *base, struct timer_list *timer)
>
> /*
> * We might have to IPI the remote CPU if the base is idle and the
> - * timer is not deferrable. If the other CPU is on the way to idle
> - * then it can't set base->is_idle as we hold the base lock:
> + * timer is pinned. If it is a non pinned timer, it is only queued
> + * on the remote CPU, when timer was running during queueing. Then
> + * everything is handled by remote CPU anyway.
> + * on the way to idle then it can't set base->is_idle as we hold
> + * the base lock:
> */
> - if (base->is_idle)
> + if (base->is_idle && timer->flags & TIMER_PINNED)
> wake_up_nohz_cpu(base->cpu);

I'm probably missing something but, shouldn't there be a call to
tmigr_new_timer() on the target to handle the new non-pinned timer?

Thanks.