diff options
-rw-r--r-- | arch/frv/include/asm/processor.h | 2 | ||||
-rw-r--r-- | arch/frv/kernel/process.c | 5 | ||||
-rw-r--r-- | arch/ia64/include/asm/thread_info.h | 9 | ||||
-rw-r--r-- | arch/um/include/asm/processor-generic.h | 2 | ||||
-rw-r--r-- | kernel/fork.c | 10 |
5 files changed, 19 insertions, 9 deletions
diff --git a/arch/frv/include/asm/processor.h b/arch/frv/include/asm/processor.h index 3744f2e47f48..4b789ab182b0 100644 --- a/arch/frv/include/asm/processor.h +++ b/arch/frv/include/asm/processor.h | |||
@@ -137,7 +137,7 @@ unsigned long get_wchan(struct task_struct *p); | |||
137 | #define KSTK_ESP(tsk) ((tsk)->thread.frame0->sp) | 137 | #define KSTK_ESP(tsk) ((tsk)->thread.frame0->sp) |
138 | 138 | ||
139 | /* Allocation and freeing of basic task resources. */ | 139 | /* Allocation and freeing of basic task resources. */ |
140 | extern struct task_struct *alloc_task_struct(void); | 140 | extern struct task_struct *alloc_task_struct_node(int node); |
141 | extern void free_task_struct(struct task_struct *p); | 141 | extern void free_task_struct(struct task_struct *p); |
142 | 142 | ||
143 | #define cpu_relax() barrier() | 143 | #define cpu_relax() barrier() |
diff --git a/arch/frv/kernel/process.c b/arch/frv/kernel/process.c index efad12071c2e..9d3597526467 100644 --- a/arch/frv/kernel/process.c +++ b/arch/frv/kernel/process.c | |||
@@ -44,9 +44,10 @@ asmlinkage void ret_from_fork(void); | |||
44 | void (*pm_power_off)(void); | 44 | void (*pm_power_off)(void); |
45 | EXPORT_SYMBOL(pm_power_off); | 45 | EXPORT_SYMBOL(pm_power_off); |
46 | 46 | ||
47 | struct task_struct *alloc_task_struct(void) | 47 | struct task_struct *alloc_task_struct_node(int node) |
48 | { | 48 | { |
49 | struct task_struct *p = kmalloc(THREAD_SIZE, GFP_KERNEL); | 49 | struct task_struct *p = kmalloc_node(THREAD_SIZE, GFP_KERNEL, node); |
50 | |||
50 | if (p) | 51 | if (p) |
51 | atomic_set((atomic_t *)(p+1), 1); | 52 | atomic_set((atomic_t *)(p+1), 1); |
52 | return p; | 53 | return p; |
diff --git a/arch/ia64/include/asm/thread_info.h b/arch/ia64/include/asm/thread_info.h index b6a5ba2aca34..342004bbefe7 100644 --- a/arch/ia64/include/asm/thread_info.h +++ b/arch/ia64/include/asm/thread_info.h | |||
@@ -84,7 +84,14 @@ struct thread_info { | |||
84 | #define end_of_stack(p) (unsigned long *)((void *)(p) + IA64_RBS_OFFSET) | 84 | #define end_of_stack(p) (unsigned long *)((void *)(p) + IA64_RBS_OFFSET) |
85 | 85 | ||
86 | #define __HAVE_ARCH_TASK_STRUCT_ALLOCATOR | 86 | #define __HAVE_ARCH_TASK_STRUCT_ALLOCATOR |
87 | #define alloc_task_struct() ((struct task_struct *)__get_free_pages(GFP_KERNEL | __GFP_COMP, KERNEL_STACK_SIZE_ORDER)) | 87 | #define alloc_task_struct_node(node) \ |
88 | ({ \ | ||
89 | struct page *page = alloc_pages_node(node, GFP_KERNEL | __GFP_COMP, \ | ||
90 | KERNEL_STACK_SIZE_ORDER); \ | ||
91 | struct task_struct *ret = page ? page_address(page) : NULL; \ | ||
92 | \ | ||
93 | ret; | ||
94 | }) | ||
88 | #define free_task_struct(tsk) free_pages((unsigned long) (tsk), KERNEL_STACK_SIZE_ORDER) | 95 | #define free_task_struct(tsk) free_pages((unsigned long) (tsk), KERNEL_STACK_SIZE_ORDER) |
89 | 96 | ||
90 | #endif /* !__ASSEMBLY */ | 97 | #endif /* !__ASSEMBLY */ |
diff --git a/arch/um/include/asm/processor-generic.h b/arch/um/include/asm/processor-generic.h index bed668824b5f..d1d1b0d8a0cd 100644 --- a/arch/um/include/asm/processor-generic.h +++ b/arch/um/include/asm/processor-generic.h | |||
@@ -66,7 +66,7 @@ struct thread_struct { | |||
66 | .request = { 0 } \ | 66 | .request = { 0 } \ |
67 | } | 67 | } |
68 | 68 | ||
69 | extern struct task_struct *alloc_task_struct(void); | 69 | extern struct task_struct *alloc_task_struct_node(int node); |
70 | 70 | ||
71 | static inline void release_thread(struct task_struct *task) | 71 | static inline void release_thread(struct task_struct *task) |
72 | { | 72 | { |
diff --git a/kernel/fork.c b/kernel/fork.c index 05b92c457010..cffbe8a4e1fc 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -109,8 +109,10 @@ int nr_processes(void) | |||
109 | } | 109 | } |
110 | 110 | ||
111 | #ifndef __HAVE_ARCH_TASK_STRUCT_ALLOCATOR | 111 | #ifndef __HAVE_ARCH_TASK_STRUCT_ALLOCATOR |
112 | # define alloc_task_struct() kmem_cache_alloc(task_struct_cachep, GFP_KERNEL) | 112 | # define alloc_task_struct_node(node) \ |
113 | # define free_task_struct(tsk) kmem_cache_free(task_struct_cachep, (tsk)) | 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)) | ||
114 | static struct kmem_cache *task_struct_cachep; | 116 | static struct kmem_cache *task_struct_cachep; |
115 | #endif | 117 | #endif |
116 | 118 | ||
@@ -249,12 +251,12 @@ static struct task_struct *dup_task_struct(struct task_struct *orig) | |||
249 | struct task_struct *tsk; | 251 | struct task_struct *tsk; |
250 | struct thread_info *ti; | 252 | struct thread_info *ti; |
251 | unsigned long *stackend; | 253 | unsigned long *stackend; |
252 | 254 | int node = numa_node_id(); | |
253 | int err; | 255 | int err; |
254 | 256 | ||
255 | prepare_to_copy(orig); | 257 | prepare_to_copy(orig); |
256 | 258 | ||
257 | tsk = alloc_task_struct(); | 259 | tsk = alloc_task_struct_node(node); |
258 | if (!tsk) | 260 | if (!tsk) |
259 | return NULL; | 261 | return NULL; |
260 | 262 | ||