Re: [PATCH V1] kthread: Unify kernel_thread() and user_mode_thread()

From: Luis Chamberlain
Date: Mon Jun 05 2023 - 19:21:55 EST


On Mon, Jun 05, 2023 at 04:10:52PM -0700, Andrew Morton wrote:
> On Sat, 3 Jun 2023 09:53:02 +0800 Huacai Chen <chenhuacai@xxxxxxxxxxx> wrote:
>
> > Commit 343f4c49f2438d8 ("kthread: Don't allocate kthread_struct for init
> > and umh") introduces a new function user_mode_thread() for init and umh.
> >
> > init and umh are different from typical kernel threads since the don't
> > need a "kthread" struct and they will finally become user processes by
> > calling kernel_execve(), but on the other hand, they are also different
> > from typical user mode threads (they have no "mm" structs at creation
> > time, which is traditionally used to distinguish a user thread and a
> > kernel thread).
> >
> > So I think it is reasonable to treat init and umh as "special kernel
> > threads". Then let's unify the kernel_thread() and user_mode_thread()
> > to kernel_thread() again, and add a new 'user' parameter for init and
> > umh.
> >
> > This also makes code simpler.
>
> Seems fair enough.

I thought Eric still disagreed?

Luis