mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Mike Travis <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
This commit is contained in:
parent
ec12fa5c80
commit
6ea8bad1c0
1 changed files with 5 additions and 11 deletions
|
|
@ -74,20 +74,14 @@ static inline struct thread_info *stack_thread_info(void)
|
|||
|
||||
/* thread information allocation */
|
||||
#ifdef CONFIG_DEBUG_STACK_USAGE
|
||||
#define alloc_thread_info(tsk) \
|
||||
({ \
|
||||
struct thread_info *ret; \
|
||||
\
|
||||
ret = ((struct thread_info *) __get_free_pages(GFP_KERNEL,THREAD_ORDER)); \
|
||||
if (ret) \
|
||||
memset(ret, 0, THREAD_SIZE); \
|
||||
ret; \
|
||||
})
|
||||
#define THREAD_FLAGS (GFP_KERNEL | __GFP_ZERO)
|
||||
#else
|
||||
#define alloc_thread_info(tsk) \
|
||||
((struct thread_info *) __get_free_pages(GFP_KERNEL,THREAD_ORDER))
|
||||
#define THREAD_FLAGS GFP_KERNEL
|
||||
#endif
|
||||
|
||||
#define alloc_thread_info(tsk) \
|
||||
((struct thread_info *) __get_free_pages(THREAD_FLAGS, THREAD_ORDER))
|
||||
|
||||
#define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER)
|
||||
|
||||
#else /* !__ASSEMBLY__ */
|
||||
|
|
|
|||
Loading…
Reference in a new issue