Re: [PATCH v2] posix-cpu-timers: Dequeue per-thread timers before exchange_tids()
From: Thomas Gleixner
Date: Tue Sep 01 2026 - 11:00:44 EST
On Mon, Aug 31 2026 at 20:24, Oleg Nesterov wrote:
> On 08/31, Thomas Gleixner wrote:
>>
>> On Wed, Aug 26 2026 at 14:55, Oleg Nesterov wrote:
>> > Can we move posix_cpu_timers_exit() or the whole CONFIG_POSIX_TIMERS
>> > sequence in begin_new_exec() up, right after de_thread() before the
>> > "if (retval)" check?
>>
>> Yes, but that does not buy us anything.
>
> I didn't mean this makes sense, I just tried to understand the Hyunwoo's
> fix, in particular the placement of additional posix_cpu_timers_exit().
Fair enough. But as I was staring at it some more, I thought more about
it. Yes, we can do:
ret = de_thread()
if (ret)
goto out;
mop_up_posix_timers();
de_thread() only returns failure _before_ the TID swap, so that's safe
and spares sprinkling this extra invocation into de_thread().
What a mess.