Re: [patch V3 09/18] posix-timers: Rework timer removal

From: Thomas Gleixner
Date: Mon Mar 10 2025 - 02:34:19 EST


On Mon, Mar 10 2025 at 00:17, Frederic Weisbecker wrote:
> Le Sat, Mar 08, 2025 at 05:48:32PM +0100, Thomas Gleixner a écrit :
>> @@ -988,90 +988,56 @@ static inline void posix_timer_cleanup_i
>> }
>> }
>>
>> -/* Delete a POSIX.1b interval timer. */
>> -SYSCALL_DEFINE1(timer_delete, timer_t, timer_id)
>> +static void posix_timer_delete(struct k_itimer *timer)
>> {
>> - struct k_itimer *timer = lock_timer(timer_id);
>> -
>> -retry_delete:
>> - if (!timer)
>> - return -EINVAL;
>> -
>> - /* Prevent signal delivery and rearming. */
>> + /*
>> + * Invalidate the timer, remove it from the linked list and remove
>> + * it from the ignored list if pending.
>> + *
>> + * The invalidation must be written with siglock held so that the
>> + * signal code observes timer->it_valid == false in do_sigaction(),
>
> I guess it_valid is a leftover from previous attempts?

Ooops, yes. Fixed now.

> Aside that and the lost WARN_ON in signal delivery:
>
> Reviewed-by: Frederic Weisbecker <frederic@xxxxxxxxxx>