Re: [patch V5 21/26] posix-timers: Handle ignored list on delete and exit

From: Thomas Gleixner
Date: Wed Oct 30 2024 - 13:35:08 EST


On Wed, Oct 30 2024 at 18:06, Frederic Weisbecker wrote:
>> +
>> + /* Mop up timers which are on the ignored list */
>> + hlist_move_list(&tsk->signal->ignored_posix_timers, &timers);
>> + while (!hlist_empty(&timers))
>> + posix_timer_cleanup_ignored(hlist_entry(timers.first, struct k_itimer, list));
>
> The ignored timers should have all been removed on timer_delete() and
> itimer_delete(), right?
>
> So should it be instead:
>
> WARN_ON_ONCE(!hlist_empty(&tsk->signal->ignored_posix_timers))

Except for those which have not been removed by the application on
exit() or in a case where the kernel kills the task. Then the exit
cleanup has to mop up for them :)

Thanks,

tglx