[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZKM5vMK_F32Qwg98@localhost.localdomain>
Date: Mon, 3 Jul 2023 23:12:28 +0200
From: Frederic Weisbecker <frederic@...nel.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
Anna-Maria Behnsen <anna-maria@...utronix.de>,
John Stultz <jstultz@...gle.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
Stephen Boyd <sboyd@...nel.org>,
Eric Biederman <ebiederm@...ssion.com>,
Oleg Nesterov <oleg@...hat.com>
Subject: Re: [patch 16/45] posix-timers: Consolidate timer setup
Le Tue, Jun 06, 2023 at 04:37:44PM +0200, Thomas Gleixner a écrit :
> hrtimer based and CPU timers have their own way to install the new interval
> and to reset overrun and signal handling related data.
>
> Create a helper function and do the same operation for all variants.
>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> ---
> kernel/time/posix-cpu-timers.c | 15 +--------------
> kernel/time/posix-timers.c | 23 +++++++++++++++++------
> kernel/time/posix-timers.h | 1 +
> 3 files changed, 19 insertions(+), 20 deletions(-)
>
> --- a/kernel/time/posix-cpu-timers.c
> +++ b/kernel/time/posix-cpu-timers.c
> @@ -709,21 +709,8 @@ static int posix_cpu_timer_set(struct k_
> trigger_base_recalc_expires(timer, p);
>
> unlock_task_sighand(p, &flags);
> - /*
> - * Install the new reload setting, and
> - * set up the signal and overrun bookkeeping.
> - */
> - timer->it_interval = timespec64_to_ktime(new->it_interval);
>
> - /*
> - * This acts as a modification timestamp for the timer,
> - * so any automatic reload attempt will punt on seeing
> - * that we have reset the timer manually.
> - */
> - timer->it_requeue_pending = (timer->it_requeue_pending + 2) &
> - ~REQUEUE_PENDING;
> - timer->it_overrun_last = 0;
> - timer->it_overrun = -1;
> + posix_timer_set_common(timer, new);
So before this patch if a posix cpu timer is set with:
.it_value = 0,
.it_interval = 5
a further retrieval would return the same. But after this patch
it will return:
.it_value = 0,
.it_interval = 0
That's an ABI change, not sure if it matters though...
Powered by blists - more mailing lists