summaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2012-05-05 15:05:46 +0000
committerThomas Gleixner <tglx@linutronix.de>2012-05-08 14:08:45 +0200
commitdf9a7b9b5d1a5ef8cd3474d0cea2c6428542e288 (patch)
tree4754c209b5df6eec595cb18ef9f0bb2e59a511d9 /arch/sh/kernel
parentc03a6a7ba6f456663e4b254cdde460b24c0852e1 (diff)
downloadlinux-df9a7b9b5d1a5ef8cd3474d0cea2c6428542e288.tar.bz2
sh-use-common-threadinfo-allocator
The core now has a threadinfo allocator which uses a kmemcache when THREAD_SIZE < PAGE_SIZE. Deal with the xstate cleanup in the new arch_release_task_struct() function. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Paul Mundt <lethal@linux-sh.org> Link: http://lkml.kernel.org/r/20120505150142.189348931@linutronix.de
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r--arch/sh/kernel/process.c46
1 files changed, 2 insertions, 44 deletions
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c
index 325f98b1736d..f2621abdf01d 100644
--- a/arch/sh/kernel/process.c
+++ b/arch/sh/kernel/process.c
@@ -29,52 +29,10 @@ void free_thread_xstate(struct task_struct *tsk)
}
}
-#if THREAD_SHIFT < PAGE_SHIFT
-static struct kmem_cache *thread_info_cache;
-
-struct thread_info *alloc_thread_info_node(struct task_struct *tsk, int node)
-{
- struct thread_info *ti;
-#ifdef CONFIG_DEBUG_STACK_USAGE
- gfp_t mask = GFP_KERNEL | __GFP_ZERO;
-#else
- gfp_t mask = GFP_KERNEL;
-#endif
-
- ti = kmem_cache_alloc_node(thread_info_cache, mask, node);
- return ti;
-}
-
-void free_thread_info(struct thread_info *ti)
-{
- free_thread_xstate(ti->task);
- kmem_cache_free(thread_info_cache, ti);
-}
-
-void thread_info_cache_init(void)
-{
- thread_info_cache = kmem_cache_create("thread_info", THREAD_SIZE,
- THREAD_SIZE, SLAB_PANIC, NULL);
-}
-#else
-struct thread_info *alloc_thread_info_node(struct task_struct *tsk, int node)
-{
-#ifdef CONFIG_DEBUG_STACK_USAGE
- gfp_t mask = GFP_KERNEL | __GFP_ZERO;
-#else
- gfp_t mask = GFP_KERNEL;
-#endif
- struct page *page = alloc_pages_node(node, mask, THREAD_SIZE_ORDER);
-
- return page ? page_address(page) : NULL;
-}
-
-void free_thread_info(struct thread_info *ti)
+void arch_release_task_struct(struct task_struct *tsk)
{
- free_thread_xstate(ti->task);
- free_pages((unsigned long)ti, THREAD_SIZE_ORDER);
+ free_thread_xstate(tsk);
}
-#endif /* THREAD_SHIFT < PAGE_SHIFT */
void arch_task_cache_init(void)
{