From: Frederic Weisbecker <frederic@kernel.org>
To: Anna-Maria Behnsen <anna-maria@linutronix.de>
Cc: linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
John Stultz <jstultz@google.com>,
Thomas Gleixner <tglx@linutronix.de>,
Eric Dumazet <edumazet@google.com>,
"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
Arjan van de Ven <arjan@infradead.org>,
"Paul E . McKenney" <paulmck@kernel.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Rik van Riel <riel@surriel.com>,
Steven Rostedt <rostedt@goodmis.org>,
Sebastian Siewior <bigeasy@linutronix.de>,
Giovanni Gherdovich <ggherdovich@suse.cz>,
Lukasz Luba <lukasz.luba@arm.com>,
"Gautham R . Shenoy" <gautham.shenoy@amd.com>
Subject: Re: [PATCH v6 07/21] timers: Introduce add_timer() variants which modify timer flags
Date: Mon, 5 Jun 2023 23:43:18 +0200 [thread overview]
Message-ID: <ZH5W9hxUahwjVBbH@localhost.localdomain> (raw)
In-Reply-To: <20230510072817.116056-8-anna-maria@linutronix.de>
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@linutronix.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.
next prev parent reply other threads:[~2023-06-05 21:43 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-10 7:27 [PATCH v6 00/21] timer: Move from a push remote at enqueue to a pull at expiry model Anna-Maria Behnsen
2023-05-10 7:27 ` [PATCH v6 01/21] tick-sched: Warn when next tick seems to be in the past Anna-Maria Behnsen
2023-05-10 7:27 ` [PATCH v6 02/21] timer: Do not IPI for deferrable timers Anna-Maria Behnsen
2023-05-10 7:27 ` [PATCH v6 03/21] timer: Add comment to get_next_timer_interrupt() description Anna-Maria Behnsen
2023-05-10 7:28 ` [PATCH v6 04/21] timer: Move store of next event into __next_timer_interrupt() Anna-Maria Behnsen
2023-05-10 7:28 ` [PATCH v6 05/21] timer: Split next timer interrupt logic Anna-Maria Behnsen
2023-05-10 7:28 ` [PATCH v6 06/21] timer: Rework idle logic Anna-Maria Behnsen
2023-05-10 7:28 ` [PATCH v6 07/21] timers: Introduce add_timer() variants which modify timer flags Anna-Maria Behnsen
2023-06-05 21:43 ` Frederic Weisbecker [this message]
2023-05-10 7:28 ` [PATCH v6 08/21] workqueue: Use global variant for add_timer() Anna-Maria Behnsen
2023-05-10 19:30 ` Tejun Heo
2023-06-05 22:16 ` Frederic Weisbecker
2023-05-10 7:28 ` [PATCH v6 09/21] timer: add_timer_on(): Make sure TIMER_PINNED flag is set Anna-Maria Behnsen
2023-06-05 22:12 ` Frederic Weisbecker
2023-05-10 7:28 ` [PATCH v6 10/21] timers: Ease code in run_local_timers() Anna-Maria Behnsen
2023-05-10 7:28 ` [PATCH v6 11/21] timers: Create helper function to forward timer base clk Anna-Maria Behnsen
2023-05-10 7:28 ` [PATCH v6 12/21] timer: Keep the pinned timers separate from the others Anna-Maria Behnsen
2023-05-10 7:28 ` [PATCH v6 13/21] timer: Retrieve next expiry of pinned/non-pinned timers separately Anna-Maria Behnsen
2023-05-10 7:28 ` [PATCH v6 14/21] timer: Split out "get next timer interrupt" functionality Anna-Maria Behnsen
2023-05-10 7:28 ` [PATCH v6 15/21] timer: Add get next timer interrupt functionality for remote CPUs Anna-Maria Behnsen
2023-05-10 10:16 ` Frederic Weisbecker
2023-05-11 13:06 ` Anna-Maria Behnsen
2023-05-10 7:28 ` [PATCH v6 16/21] timer: Restructure internal locking Anna-Maria Behnsen
2023-05-10 7:28 ` [PATCH v6 17/21] timer: Check if timers base is handled already Anna-Maria Behnsen
2023-05-10 7:28 ` [PATCH v6 18/21] tick/sched: Split out jiffies update helper function Anna-Maria Behnsen
2023-05-10 7:28 ` [PATCH v6 19/21] timer: Implement the hierarchical pull model Anna-Maria Behnsen
2023-05-10 10:32 ` Frederic Weisbecker
2023-05-15 10:19 ` Sebastian Siewior
2023-05-15 10:50 ` Anna-Maria Behnsen
2023-05-15 12:41 ` Sebastian Siewior
2023-05-16 9:24 ` Frederic Weisbecker
2023-05-16 9:37 ` Sebastian Siewior
2023-05-16 12:49 ` Anna-Maria Behnsen
2023-05-16 9:15 ` Frederic Weisbecker
2023-05-11 16:56 ` Sebastian Siewior
2023-05-15 11:06 ` Sebastian Siewior
2023-05-19 9:32 ` kernel test robot
2023-05-10 7:28 ` [PATCH v6 20/21] timer_migration: Add tracepoints Anna-Maria Behnsen
2023-05-10 7:28 ` [PATCH v6 21/21] timer: Always queue timers on the local CPU Anna-Maria Behnsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZH5W9hxUahwjVBbH@localhost.localdomain \
--to=frederic@kernel.org \
--cc=anna-maria@linutronix.de \
--cc=arjan@infradead.org \
--cc=bigeasy@linutronix.de \
--cc=edumazet@google.com \
--cc=fweisbec@gmail.com \
--cc=gautham.shenoy@amd.com \
--cc=ggherdovich@suse.cz \
--cc=jstultz@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=rafael.j.wysocki@intel.com \
--cc=riel@surriel.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.