kernel/fork: use vfree_atomic() to free thread stack
authorAndrey Ryabinin <[email protected]>
Tue, 13 Dec 2016 00:44:14 +0000 (16:44 -0800)
committerLinus Torvalds <[email protected]>
Tue, 13 Dec 2016 02:55:08 +0000 (18:55 -0800)
vfree() is going to use sleeping lock.  Thread stack freed in atomic
context, therefore we must use vfree_atomic() here.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Andrey Ryabinin <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Cc: Joel Fernandes <[email protected]>
Cc: Jisheng Zhang <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: John Dias <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ingo Molnar <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
kernel/fork.c

index 7ffa16033ded3549172aec2afd16c12184783c6b..00492b22adfe73070cf70e3ecbfc41692df603d5 100644 (file)
@@ -229,7 +229,7 @@ static inline void free_thread_stack(struct task_struct *tsk)
                }
                local_irq_restore(flags);
 
-               vfree(tsk->stack);
+               vfree_atomic(tsk->stack);
                return;
        }
 #endif