Re: [PATCH v3 3/6] exit: postpone tty_kref_put() until after tasklist_lock is dropped

Oleg Nesterov
2025-02-03T18:07:00Z

On 02/01, Mateusz Guzik wrote:
>
> Instead of smuggling the tty pointer directly, use a struct so that more
> things can be added later.

I am not sure this particular change worth the effort, but I won't argue.
I'd like to know what Eric thinks.

OTOH, if we do this, then perhaps we can do more "call tty_kref_put()
lockless" changes later. And perhaps even add the new

void tty_kref_put_sync(struct tty_struct *tty)
{
if (tty)
kref_put(&tty->kref, release_one_tty);
}

helper. With this change release_task() doesn't need to abuse
schedule_work(), and this helper can have more users.

Nevermind, this is almost off-topic.

Oleg.