lkml.org 
[lkml]   [2022]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/3] kthread: Remove the flags argument from kernel_thread
On Sun, Jun 26, 2022 at 12:15 PM Eric W. Biederman
<ebiederm@xmission.com> wrote:
>
> As kthreadd never exists it simply does not matter what kind of exit
> it has. So for simplicity make it look like everything else and use
> SIGCHLD.

That "never exists" should be "never exits" ;)

But:

> +pid_t kernel_thread(int (*fn)(void *), void *arg)
> {
> + unsigned long flags = CLONE_FS | CLONE_FILES | SIGCHLD;
> struct kernel_clone_args args = {
> .flags = ((lower_32_bits(flags) | CLONE_VM |
> CLONE_UNTRACED) & ~CSIGNAL),

Please just get rid of that 'flags' thing, and the lower_32_bits()
games and write this all as

pid_t kernel_thread(int (*fn)(void *), void *arg)
{
struct kernel_clone_args args = {
.flags = CLONE_FS | CLONE_FILES |
CLONE_VM | CLONE_UNTRACED,
.exit_signal = SIGCHLD,
...

which does that whole thing much more clearly.

Linus

\
 
 \ /
  Last update: 2022-06-26 23:22    [W:0.157 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site