[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZyTO7mFZWRZf7sNv@localhost.localdomain>
Date: Fri, 1 Nov 2024 13:51:58 +0100
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 v6 02/20] posix-timers: Make signal overrun accounting
sensible
Le Thu, Oct 31, 2024 at 04:46:25PM +0100, Thomas Gleixner a écrit :
> The handling of the timer overrun in the signal code is inconsistent as it
> takes previous overruns into account. This is just wrong as after the
> reprogramming of a timer the overrun count starts over from a clean state,
> i.e. 0.
>
> Don't touch info::si_overrun in send_sigqueue() and only store the overrun
> value at signal delivery time, which is computed from the timer itself
> relative to the expiry time.
>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> Acked-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> ---
> V6: Fold the timer_overrun_to_int() cleanup from Frederic and remove all
> overrun fiddling from the signal path.
> ---
> kernel/signal.c | 6 ------
> kernel/time/posix-timers.c | 11 ++++++-----
> 2 files changed, 6 insertions(+), 11 deletions(-)
> ---
>
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -1968,15 +1968,9 @@ int send_sigqueue(struct sigqueue *q, st
>
> ret = 0;
> if (unlikely(!list_empty(&q->list))) {
> - /*
> - * If an SI_TIMER entry is already queue just increment
> - * the overrun count.
> - */
> - q->info.si_overrun++;
> result = TRACE_SIGNAL_ALREADY_PENDING;
> goto out;
> }
> - q->info.si_overrun = 0;
So it's not cleared anymore on signal queue?
Not sure if it's a big problem but if an interval timer gets a signal with
overruns and then the timer is reset later as non interval, the resulting
upcoming signals will still carry the previous non-zero overruns?
However it's better to keep the overrun update on a single place so
perhaps this?
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index 66ed49efc02f..f06c52731d65 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -282,6 +282,8 @@ bool posixtimer_deliver_signal(struct kernel_siginfo *info)
++timr->it_signal_seq;
info->si_overrun = timer_overrun_to_int(timr);
+ } else {
+ info->si_overrun = 0;
}
ret = true;
Other than that:
Reviewed-by: Frederic Weisbecker <frederic@...nel.org>
Powered by blists - more mailing lists