diff options
-rw-r--r-- | include/linux/thread_info.h | 6 | ||||
-rw-r--r-- | kernel/fork.c | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h index 8d03f079688c..db78775eff3b 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h | |||
@@ -54,6 +54,12 @@ extern long do_no_restart_syscall(struct restart_block *parm); | |||
54 | 54 | ||
55 | #ifdef __KERNEL__ | 55 | #ifdef __KERNEL__ |
56 | 56 | ||
57 | #ifdef CONFIG_DEBUG_STACK_USAGE | ||
58 | # define THREADINFO_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO) | ||
59 | #else | ||
60 | # define THREADINFO_GFP (GFP_KERNEL | __GFP_NOTRACK) | ||
61 | #endif | ||
62 | |||
57 | /* | 63 | /* |
58 | * flag set/clear/test wrappers | 64 | * flag set/clear/test wrappers |
59 | * - pass TIF_xxxx constants to these functions | 65 | * - pass TIF_xxxx constants to these functions |
diff --git a/kernel/fork.c b/kernel/fork.c index a79b36e2e912..5d22b9b8cf7b 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -123,12 +123,8 @@ static struct kmem_cache *task_struct_cachep; | |||
123 | static struct thread_info *alloc_thread_info_node(struct task_struct *tsk, | 123 | static struct thread_info *alloc_thread_info_node(struct task_struct *tsk, |
124 | int node) | 124 | int node) |
125 | { | 125 | { |
126 | #ifdef CONFIG_DEBUG_STACK_USAGE | 126 | struct page *page = alloc_pages_node(node, THREADINFO_GFP, |
127 | gfp_t mask = GFP_KERNEL | __GFP_ZERO; | 127 | THREAD_SIZE_ORDER); |
128 | #else | ||
129 | gfp_t mask = GFP_KERNEL; | ||
130 | #endif | ||
131 | struct page *page = alloc_pages_node(node, mask, THREAD_SIZE_ORDER); | ||
132 | 128 | ||
133 | return page ? page_address(page) : NULL; | 129 | return page ? page_address(page) : NULL; |
134 | } | 130 | } |