aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/thread_info_64.h
diff options
context:
space:
mode:
authorclameter@sgi.com <clameter@sgi.com>2008-01-30 07:30:32 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:30:32 -0500
commit6ea8bad1c06c8ccde381f1c848afe6a245bb33b5 (patch)
tree41fd63390baf34cef3ce4ca16b525cef879c6079 /include/asm-x86/thread_info_64.h
parentec12fa5c80126b252ebcb474d12c832ec4647daa (diff)
x86: clean up stack allocation and free
Clean up the allocation and freeing of stacks a bit by using a __GFP_ZERO flag instead of memset. Signed-off-by: Christoph Lameter <clameter@sgi.com> Cc: Andi Kleen <ak@suse.de> Cc: Mike Travis <travis@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/thread_info_64.h')
-rw-r--r--include/asm-x86/thread_info_64.h16
1 files changed, 5 insertions, 11 deletions
diff --git a/include/asm-x86/thread_info_64.h b/include/asm-x86/thread_info_64.h
index 7f6ee68f0002..1ac23c157231 100644
--- a/include/asm-x86/thread_info_64.h
+++ b/include/asm-x86/thread_info_64.h
@@ -74,20 +74,14 @@ static inline struct thread_info *stack_thread_info(void)
74 74
75/* thread information allocation */ 75/* thread information allocation */
76#ifdef CONFIG_DEBUG_STACK_USAGE 76#ifdef CONFIG_DEBUG_STACK_USAGE
77#define alloc_thread_info(tsk) \ 77#define THREAD_FLAGS (GFP_KERNEL | __GFP_ZERO)
78 ({ \
79 struct thread_info *ret; \
80 \
81 ret = ((struct thread_info *) __get_free_pages(GFP_KERNEL,THREAD_ORDER)); \
82 if (ret) \
83 memset(ret, 0, THREAD_SIZE); \
84 ret; \
85 })
86#else 78#else
87#define alloc_thread_info(tsk) \ 79#define THREAD_FLAGS GFP_KERNEL
88 ((struct thread_info *) __get_free_pages(GFP_KERNEL,THREAD_ORDER))
89#endif 80#endif
90 81
82#define alloc_thread_info(tsk) \
83 ((struct thread_info *) __get_free_pages(THREAD_FLAGS, THREAD_ORDER))
84
91#define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER) 85#define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER)
92 86
93#else /* !__ASSEMBLY__ */ 87#else /* !__ASSEMBLY__ */