lkml.org 
[lkml]   [2005]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[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.

Alan Stern



Signed-off-by: Alan Stern <stern@rowland.harvard.edu>

---
What I said above may not be quite true. For all I know, there may be
threads which rely on inheriting PF_NOFREEZE from their parent. But it
should not be inherited by default.

Index: usb-2.6/kernel/fork.c
===================================================================
--- usb-2.6.orig/kernel/fork.c
+++ usb-2.6/kernel/fork.c
@@ -848,7 +848,7 @@ static inline void copy_flags(unsigned l
{
unsigned long new_flags = p->flags;

- new_flags &= ~PF_SUPERPRIV;
+ new_flags &= ~(PF_SUPERPRIV | PF_NOFREEZE);
new_flags |= PF_FORKNOEXEC;
if (!(clone_flags & CLONE_PTRACE))
p->ptrace = 0;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-10-18 21:32    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site