All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@kernel.org>
To: Hyunwoo Kim <imv4bel@gmail.com>,
	Frederic Weisbecker <frederic@kernel.org>,
	Anna-Maria Behnsen <anna-maria@linutronix.de>,
	Kees Cook <kees@kernel.org>,
	Christian Brauner <brauner@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Oleg Nesterov <oleg@redhat.com>, John Stultz <jstultz@google.com>,
	Ingo Molnar <mingo@kernel.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org, Hyunwoo Kim <imv4bel@gmail.com>
Subject: Re: [PATCH v2] posix-cpu-timers: Dequeue per-thread timers before exchange_tids()
Date: Mon, 31 Aug 2026 18:19:05 +0200	[thread overview]
Message-ID: <878q5mclfq.ffs@fw13> (raw)
In-Reply-To: <87bjaicxm0.ffs@fw13>

On Mon, Aug 31 2026 at 13:56, Thomas Gleixner wrote:
> On Wed, Aug 26 2026 at 20:41, Hyunwoo Kim wrote:
>> diff --git a/fs/exec.c b/fs/exec.c
>> index 745f6eb5279e6..9b2d140bd9f2a 100644
>> --- a/fs/exec.c
>> +++ b/fs/exec.c
>> @@ -1003,6 +1003,18 @@ static int de_thread(struct task_struct *tsk)
>>  		 * the former thread group leader:
>>  		 */
>>  
>> +#ifdef CONFIG_POSIX_TIMERS
>> +		/*
>> +		 * exchange_tids() hands this thread's PID to the old leader,
>> +		 * which is reaped right after. The PID lookup in
>> +		 * timer_lock_sighand() then fails while the per thread CPU
>> +		 * timers are still queued here, so dequeue them first.
>> +		 */
>> +		spin_lock(lock);
>> +		posix_cpu_timers_exit(tsk);
>> +		spin_unlock(lock);
>> +#endif
>> +
>>  		/* Become a process group leader with the old leader's pid.
>>  		 * The old leader becomes a thread of the this thread group.
>>  		 */
>
> Similar to the other issue vs. POSIX timer signals this really wants to
> be solved in exit() independent of non-leader exec(). Let me have a
> look.

Duh. That's about the non-leader itself....

Why did anyone think that swapping TIDs is a brilliant idea?

I still think that this should be done differently. There is no point in
doing the disarming in release_task(). Let me think some more.



      reply	other threads:[~2026-08-31 16:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-26 11:41 [PATCH v2] posix-cpu-timers: Dequeue per-thread timers before exchange_tids() Hyunwoo Kim
2026-08-26 12:55 ` Oleg Nesterov
2026-08-27 13:13   ` Hyunwoo Kim
2026-08-31 16:20   ` Thomas Gleixner
2026-08-31 18:24     ` Oleg Nesterov
2026-09-01 14:50       ` Thomas Gleixner
2026-09-01 15:11         ` Thomas Gleixner
2026-08-31 11:56 ` Thomas Gleixner
2026-08-31 16:19   ` Thomas Gleixner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878q5mclfq.ffs@fw13 \
    --to=tglx@kernel.org \
    --cc=anna-maria@linutronix.de \
    --cc=brauner@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=frederic@kernel.org \
    --cc=imv4bel@gmail.com \
    --cc=jack@suse.cz \
    --cc=jstultz@google.com \
    --cc=kees@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.