fork.c (504f52b5439aaf26d3e2c1d45ec10fce38c8dd27) fork.c (b6a84016bd2598e35ead635147fa53619982648d)
1/*
2 * linux/kernel/fork.c
3 *
4 * Copyright (C) 1991, 1992 Linus Torvalds
5 */
6
7/*
8 * 'fork.c' contains the help-routines for the 'fork' system call

--- 103 unchanged lines hidden (view full) ---

112# define alloc_task_struct_node(node) \
113 kmem_cache_alloc_node(task_struct_cachep, GFP_KERNEL, node)
114# define free_task_struct(tsk) \
115 kmem_cache_free(task_struct_cachep, (tsk))
116static struct kmem_cache *task_struct_cachep;
117#endif
118
119#ifndef __HAVE_ARCH_THREAD_INFO_ALLOCATOR
1/*
2 * linux/kernel/fork.c
3 *
4 * Copyright (C) 1991, 1992 Linus Torvalds
5 */
6
7/*
8 * 'fork.c' contains the help-routines for the 'fork' system call

--- 103 unchanged lines hidden (view full) ---

112# define alloc_task_struct_node(node) \
113 kmem_cache_alloc_node(task_struct_cachep, GFP_KERNEL, node)
114# define free_task_struct(tsk) \
115 kmem_cache_free(task_struct_cachep, (tsk))
116static struct kmem_cache *task_struct_cachep;
117#endif
118
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#ifdef CONFIG_DEBUG_STACK_USAGE
123 gfp_t mask = GFP_KERNEL | __GFP_ZERO;
124#else
125 gfp_t mask = GFP_KERNEL;
126#endif
122{
123#ifdef CONFIG_DEBUG_STACK_USAGE
124 gfp_t mask = GFP_KERNEL | __GFP_ZERO;
125#else
126 gfp_t mask = GFP_KERNEL;
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}
129
130static inline void free_thread_info(struct thread_info *ti)
131{
132 free_pages((unsigned long)ti, THREAD_SIZE_ORDER);
133}
134#endif
135

--- 119 unchanged lines hidden (view full) ---

255 int err;
256
257 prepare_to_copy(orig);
258
259 tsk = alloc_task_struct_node(node);
260 if (!tsk)
261 return NULL;
262
131}
132
133static inline void free_thread_info(struct thread_info *ti)
134{
135 free_pages((unsigned long)ti, THREAD_SIZE_ORDER);
136}
137#endif
138

--- 119 unchanged lines hidden (view full) ---

258 int err;
259
260 prepare_to_copy(orig);
261
262 tsk = alloc_task_struct_node(node);
263 if (!tsk)
264 return NULL;
265
263 ti = alloc_thread_info(tsk);
266 ti = alloc_thread_info_node(tsk, node);
264 if (!ti) {
265 free_task_struct(tsk);
266 return NULL;
267 }
268
269 err = arch_dup_task_struct(tsk, orig);
270 if (err)
271 goto out;

--- 1493 unchanged lines hidden ---
267 if (!ti) {
268 free_task_struct(tsk);
269 return NULL;
270 }
271
272 err = arch_dup_task_struct(tsk, orig);
273 if (err)
274 goto out;

--- 1493 unchanged lines hidden ---