[patch 07/18] cris: Use common threadinfo allocator

From: Thomas Gleixner
Date: Sat May 05 2012 - 11:06:41 EST


There is no functional difference. __get_free_pages() ends up calling
alloc_pages_node().

This also allocates only one page which matches THREAD_SIZE instead of
an extra page for nothing.

Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Jesper Nilsson <jesper.nilsson@xxxxxxxx>
---
arch/cris/include/asm/processor.h | 5 ++---
arch/cris/include/asm/thread_info.h | 6 ------
2 files changed, 2 insertions(+), 9 deletions(-)

Index: tip/arch/cris/include/asm/processor.h
===================================================================
--- tip.orig/arch/cris/include/asm/processor.h
+++ tip/arch/cris/include/asm/processor.h
@@ -25,13 +25,12 @@ struct task_struct;
*/
#define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3))

-/* THREAD_SIZE is the size of the task_struct/kernel_stack combo.
+/* THREAD_SIZE is the size of the thread_info/kernel_stack combo.
* normally, the stack is found by doing something like p + THREAD_SIZE
* in CRIS, a page is 8192 bytes, which seems like a sane size
*/
-
#define THREAD_SIZE PAGE_SIZE
-#define KERNEL_STACK_SIZE PAGE_SIZE
+#define THREAD_SIZE_ORDER (0)

/*
* At user->kernel entry, the pt_regs struct is stacked on the top of the kernel-stack.
Index: tip/arch/cris/include/asm/thread_info.h
===================================================================
--- tip.orig/arch/cris/include/asm/thread_info.h
+++ tip/arch/cris/include/asm/thread_info.h
@@ -65,12 +65,6 @@ struct thread_info {

#define init_thread_info (init_thread_union.thread_info)

-#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
-/* thread information allocation */
-#define alloc_thread_info_node(tsk, node) \
- ((struct thread_info *) __get_free_pages(GFP_KERNEL, 1))
-#define free_thread_info(ti) free_pages((unsigned long) (ti), 1)
-
#endif /* !__ASSEMBLY__ */

/*


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/