[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZH5W9hxUahwjVBbH@localhost.localdomain>
Date: Mon, 5 Jun 2023 23:43:18 +0200
From: Frederic Weisbecker <frederic@...nel.org>
To: Anna-Maria Behnsen <anna-maria@...utronix.de>
Cc: linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
John Stultz <jstultz@...gle.com>,
Thomas Gleixner <tglx@...utronix.de>,
Eric Dumazet <edumazet@...gle.com>,
"Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
Arjan van de Ven <arjan@...radead.org>,
"Paul E . McKenney" <paulmck@...nel.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Rik van Riel <riel@...riel.com>,
Steven Rostedt <rostedt@...dmis.org>,
Sebastian Siewior <bigeasy@...utronix.de>,
Giovanni Gherdovich <ggherdovich@...e.cz>,
Lukasz Luba <lukasz.luba@....com>,
"Gautham R . Shenoy" <gautham.shenoy@....com>
Subject: Re: [PATCH v6 07/21] timers: Introduce add_timer() variants which
modify timer flags
Le Wed, May 10, 2023 at 09:28:03AM +0200, Anna-Maria Behnsen a écrit :
> Timer might be used as pinned timer (using add_timer_on()) and later on as
> non pinned timers using add_timer(). When the NOHZ timer pull at expiry
> model is in place, TIMER_PINNED flag is required to be used whenever a
> timer needs to expire on a dedicated CPU. Flag must no be set, if
> expiration on a dedicated CPU is not required.
>
> add_timer_on()'s behavior will be changed during the preparation patches
> for the NOHZ timer pull at expiry model to unconditionally set TIMER_PINNED
> flag. To be able to reset/set the flag when queueing a timer, two variants
> of add_timer() are introduced.
>
> This is a preparatory patch and has no functional change.
>
> Signed-off-by: Anna-Maria Behnsen <anna-maria@...utronix.de>
> ---
> New in v6
> ---
> include/linux/timer.h | 2 ++
> kernel/time/timer.c | 34 ++++++++++++++++++++++++++++++++++
> 2 files changed, 36 insertions(+)
>
> diff --git a/include/linux/timer.h b/include/linux/timer.h
> index 9162f275819a..6f96661480dd 100644
> --- a/include/linux/timer.h
> +++ b/include/linux/timer.h
> @@ -180,6 +180,8 @@ extern int timer_reduce(struct timer_list *timer, unsigned long expires);
> #define NEXT_TIMER_MAX_DELTA ((1UL << 30) - 1)
>
> extern void add_timer(struct timer_list *timer);
> +extern void add_timer_local(struct timer_list *timer);
> +extern void add_timer_global(struct timer_list *timer);
>
> extern int try_to_del_timer_sync(struct timer_list *timer);
> extern int timer_delete_sync(struct timer_list *timer);
> diff --git a/kernel/time/timer.c b/kernel/time/timer.c
> index 1522fb81887e..ab9a8bb11a8a 100644
> --- a/kernel/time/timer.c
> +++ b/kernel/time/timer.c
> @@ -1242,6 +1242,40 @@ void add_timer(struct timer_list *timer)
> }
> EXPORT_SYMBOL(add_timer);
>
> +/**
> + * add_timer_local - Start a timer on the local CPU
> + * @timer: The timer to be started
> + *
> + * Same as add_timer() except that the timer flag TIMER_PINNED is set.
> + *
> + * See add_timer() for further details.
> + */
> +void add_timer_local(struct timer_list *timer)
> +{
> + if (WARN_ON_ONCE(timer_pending(timer)))
> + return;
> + timer->flags |= TIMER_PINNED;
> + __mod_timer(timer, timer->expires, MOD_TIMER_NOTPENDING);
> +}
> +EXPORT_SYMBOL(add_timer_local);
This one doesn't seem to be used at the end of the patchset.
Thanks.
Powered by blists - more mailing lists