aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/fork.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index cffbe8a4e1fc..cbc6adc6e891 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -117,14 +117,17 @@ static struct kmem_cache *task_struct_cachep;
117#endif 117#endif
118 118
119#ifndef __HAVE_ARCH_THREAD_INFO_ALLOCATOR 119#ifndef __HAVE_ARCH_THREAD_INFO_ALLOCATOR
120static inline struct thread_info *alloc_thread_info(struct task_struct *tsk) 120static struct thread_info *alloc_thread_info_node(struct task_struct *tsk,
121 int node)
121{ 122{
122#ifdef CONFIG_DEBUG_STACK_USAGE 123#ifdef CONFIG_DEBUG_STACK_USAGE
123 gfp_t mask = GFP_KERNEL | __GFP_ZERO; 124 gfp_t mask = GFP_KERNEL | __GFP_ZERO;
124#else 125#else
125 gfp_t mask = GFP_KERNEL; 126 gfp_t mask = GFP_KERNEL;
126#endif 127#endif
127 return (struct thread_info *)__get_free_pages(mask, THREAD_SIZE_ORDER); 128 struct page *page = alloc_pages_node(node, mask, THREAD_SIZE_ORDER);
129
130 return page ? page_address(page) : NULL;
128} 131}
129 132
130static inline void free_thread_info(struct thread_info *ti) 133static inline void free_thread_info(struct thread_info *ti)
@@ -260,7 +263,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
260 if (!tsk) 263 if (!tsk)
261 return NULL; 264 return NULL;
262 265
263 ti = alloc_thread_info(tsk); 266 ti = alloc_thread_info_node(tsk, node);
264 if (!ti) { 267 if (!ti) {
265 free_task_struct(tsk); 268 free_task_struct(tsk);
266 return NULL; 269 return NULL;