Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] Threads shouldn't inherit PF_NOFREEZE

The PF_NOFREEZE process flag should not be inherited when a thread is
forked. This patch (as585) removes the flag from the child.

This problem is starting to show up more and more as drivers turn to the
kthread API instead of using kernel_thread(). As a result, their kernel
threads are now children of the kthread worker instead of modprobe, and
they inherit the PF_NOFREEZE flag. This can cause problems during system
suspend; the kernel threads are not getting frozen as they ought to be.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Alan Stern and committed by
Linus Torvalds
d1209d04 f9b25fab

+1 -1
+1 -1
kernel/fork.c
··· 848 848 { 849 849 unsigned long new_flags = p->flags; 850 850 851 - new_flags &= ~PF_SUPERPRIV; 851 + new_flags &= ~(PF_SUPERPRIV | PF_NOFREEZE); 852 852 new_flags |= PF_FORKNOEXEC; 853 853 if (!(clone_flags & CLONE_PTRACE)) 854 854 p->ptrace = 0;