Skip to contentSkip to conversation

problem with "Use CLONE_KERNEL for the common kernel thread flags"?

DISCUSSION Matthew Wilcox 3 participants 3 messages Sep 15, 2002

lore
Share & tools
lore
#0 lore raw

Seems to me like you missed something in your latest changeset:

-#define CLONE_SIGNAL (CLONE_SIGHAND | CLONE_THREAD)
+#define CLONE_KERNEL (CLONE_FS | CLONE_FILES | CLONE_SIGHAND)
- kernel_thread(init, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGNAL);
+ kernel_thread(init, NULL, CLONE_KERNEL);

init used to be spawned with CLONE_THREAD and no longer is. Was this intentional? The changelog entry didn't indicate it, and I haven't been keeping track of what all the CLONE flags mean these days so I'm not sure if this is safe.

Signature · 1 line
Revolutions do not require corporate support.
#1 lore raw
Quoted 7 lines · Matthew Wilcox
(quoted diff) +2 -2
-#define CLONE_SIGNAL   (CLONE_SIGHAND | CLONE_THREAD)
+#define CLONE_KERNEL   (CLONE_FS | CLONE_FILES | CLONE_SIGHAND)
-       kernel_thread(init, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGNAL);
+       kernel_thread(init, NULL, CLONE_KERNEL);

init used to be spawned with CLONE_THREAD and no longer is. Was this intentional? [...]

i think Linus combined a cleanup with the fix i sent earlier today, so this does look intentional.

Ingo

#2 lore raw
In reply to Matthew Wilcox
Quoted 10 lines · Matthew Wilcox

Seems to me like you missed something in your latest changeset:

(quoted diff) +2 -2
-#define CLONE_SIGNAL   (CLONE_SIGHAND | CLONE_THREAD)
+#define CLONE_KERNEL   (CLONE_FS | CLONE_FILES | CLONE_SIGHAND)
-       kernel_thread(init, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGNAL);
+       kernel_thread(init, NULL, CLONE_KERNEL);

init used to be spawned with CLONE_THREAD and no longer is. Was this intentional?

Yup. CLONE_THREAD has some new semantics these days, and is not necessarily at all what a kernel thread wants any more. It used to not matter at all, but these days it means that it gets put on the same thread group list as the parent, which means that it won't show up on the global list of processes any more (since it is considered a "subthread" of the thread group leader).

Linus