Re: [PATCH] kthread: remove kthread_exit()

From: Christoph Hellwig

Date: Tue Mar 10 2026 - 10:28:52 EST


On Mon, Mar 09, 2026 at 09:37:26AM -0700, Linus Torvalds wrote:
> On Mon, 9 Mar 2026 at 08:43, Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
> >
> > Because it can't f&*^ up the state of random tasks.
>
> Christoph, you make no sense.

Thanks, I always appreciated rational and detailed answers.

>
> "do_exit()" cannot mess up random tasks. It can only exit the
> *current* task. The task that is running right now in that module.

Yes. And random code should not be able to end arbitrary tasks.

> So what is the actual problem? No more random rants. Explain yourself
> without making wild handwaving gestures.

Wow, you're a bit aggressive, aren't you? Maybe take your meds in the
morning to stay a bit calmer. As said before I don't think allowing
random code (and module is a proxy for that) do exit a task. They
really should not be exiting random kthreads either, but certainly
not more than that.

> Now, there are real exports in this area that are actually strange and
> should be removed: for some historical reason we export 'free_task()'
> which makes no sense to me at all (but probably did at some point).
>
> Now *that* is a strange export that can mess up another task in major ways.

No argument about that, but that's not the point here.