Re: [patch v6 02/20] posix-timers: Make signal overrun accounting sensible

From: Thomas Gleixner
Date: Fri Nov 01 2024 - 16:36:45 EST


On Fri, Nov 01 2024 at 13:51, Frederic Weisbecker wrote:
> Le Thu, Oct 31, 2024 at 04:46:25PM +0100, Thomas Gleixner a écrit :
>> @@ -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?

Duh. Yes.

> 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:

Let me fold that.

> Reviewed-by: Frederic Weisbecker <frederic@xxxxxxxxxx>