aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2012-05-05 11:05:44 -0400
committerThomas Gleixner <tglx@linutronix.de>2012-05-08 08:08:45 -0400
commitfe844052bca4355bf1a1b078d3e7727800cf3c73 (patch)
tree27413492b9573f40a1d978741273667a70b90de8
parente6e9c540d5d177e7a40d8b40a3b2386bdefbe5da (diff)
hexagon: Use common threadinfo allocator
The core now has a threadinfo allocator which uses a kmemcache when THREAD_SIZE < PAGE_SIZE. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Kuo <rkuo@codeaurora.org> Link: http://lkml.kernel.org/r/20120505150141.812612113@linutronix.de
-rw-r--r--arch/hexagon/include/asm/thread_info.h8
-rw-r--r--arch/hexagon/kernel/process.c37
2 files changed, 0 insertions, 45 deletions
diff --git a/arch/hexagon/include/asm/thread_info.h b/arch/hexagon/include/asm/thread_info.h
index 9c2934ff5756..4f936a7ee847 100644
--- a/arch/hexagon/include/asm/thread_info.h
+++ b/arch/hexagon/include/asm/thread_info.h
@@ -31,15 +31,7 @@
31 31
32#define THREAD_SHIFT 12 32#define THREAD_SHIFT 12
33#define THREAD_SIZE (1<<THREAD_SHIFT) 33#define THREAD_SIZE (1<<THREAD_SHIFT)
34
35#if THREAD_SHIFT >= PAGE_SHIFT
36#define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT) 34#define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT)
37#else /* don't use standard allocator */
38#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
39extern struct thread_info *alloc_thread_info_node(struct task_struct *tsk, int node);
40extern void free_thread_info(struct thread_info *ti);
41#endif
42
43 35
44#ifndef __ASSEMBLY__ 36#ifndef __ASSEMBLY__
45 37
diff --git a/arch/hexagon/kernel/process.c b/arch/hexagon/kernel/process.c
index ff02821bfb7e..af51de63b835 100644
--- a/arch/hexagon/kernel/process.c
+++ b/arch/hexagon/kernel/process.c
@@ -234,43 +234,6 @@ unsigned long get_wchan(struct task_struct *p)
234} 234}
235 235
236/* 236/*
237 * Borrowed from PowerPC -- basically allow smaller kernel stacks if we
238 * go crazy with the page sizes.
239 */
240#if THREAD_SHIFT < PAGE_SHIFT
241
242static struct kmem_cache *thread_info_cache;
243
244struct thread_info *alloc_thread_info_node(struct task_struct *tsk, int node)
245{
246 struct thread_info *ti;
247
248 ti = kmem_cache_alloc_node(thread_info_cache, GFP_KERNEL, node);
249 if (unlikely(ti == NULL))
250 return NULL;
251#ifdef CONFIG_DEBUG_STACK_USAGE
252 memset(ti, 0, THREAD_SIZE);
253#endif
254 return ti;
255}
256
257void free_thread_info(struct thread_info *ti)
258{
259 kmem_cache_free(thread_info_cache, ti);
260}
261
262/* Weak symbol; called by init/main.c */
263
264void thread_info_cache_init(void)
265{
266 thread_info_cache = kmem_cache_create("thread_info", THREAD_SIZE,
267 THREAD_SIZE, 0, NULL);
268 BUG_ON(thread_info_cache == NULL);
269}
270
271#endif /* THREAD_SHIFT < PAGE_SHIFT */
272
273/*
274 * Required placeholder. 237 * Required placeholder.
275 */ 238 */
276int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu) 239int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)