From 81834e5c4295e53a2ca3322f3acfbd1437e0993e Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Sat, 16 Feb 2008 20:20:54 -0800 Subject: vcompound: Fallbacks for order 1 stack allocations on x86 This allows fallback for order 1 stack allocations. In the fallback scenario the stacks will be virtually mapped. Note that stack fallbacks only work on platforms that have a hardware tlb lookup facility. A virtually mapped stack can cause tlb faults in critical kernel components. Processing a tlb fault may not be possible if the stack needs this tlb in order to process the fault. Signed-off-by: Christoph Lameter --- include/asm-x86/thread_info_32.h | 6 +++--- include/asm-x86/thread_info_64.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) Index: linux-2.6.25-rc8-mm2/include/asm-x86/thread_info_32.h =================================================================== --- linux-2.6.25-rc8-mm2.orig/include/asm-x86/thread_info_32.h 2008-04-12 17:04:19.559684542 -0700 +++ linux-2.6.25-rc8-mm2/include/asm-x86/thread_info_32.h 2008-04-14 20:12:01.434883495 -0700 @@ -96,13 +96,13 @@ static inline struct thread_info *curren /* thread information allocation */ #ifdef CONFIG_DEBUG_STACK_USAGE #define alloc_thread_info(tsk) ((struct thread_info *) \ - __get_free_pages(GFP_KERNEL | __GFP_ZERO, get_order(THREAD_SIZE))) + __alloc_vcompound(GFP_KERNEL | __GFP_ZERO, get_order(THREAD_SIZE))) #else #define alloc_thread_info(tsk) ((struct thread_info *) \ - __get_free_pages(GFP_KERNEL, get_order(THREAD_SIZE))) + __alloc_vcompound(GFP_KERNEL, get_order(THREAD_SIZE))) #endif -#define free_thread_info(info) free_pages((unsigned long)(info), get_order(THREAD_SIZE)) +#define free_thread_info(info) __free_vcompound(info) #else /* !__ASSEMBLY__ */ Index: linux-2.6.25-rc8-mm2/include/asm-x86/thread_info_64.h =================================================================== --- linux-2.6.25-rc8-mm2.orig/include/asm-x86/thread_info_64.h 2008-04-12 17:04:19.579683940 -0700 +++ linux-2.6.25-rc8-mm2/include/asm-x86/thread_info_64.h 2008-04-14 20:12:35.562000163 -0700 @@ -83,9 +83,9 @@ static inline struct thread_info *stack_ #endif #define alloc_thread_info(tsk) \ - ((struct thread_info *)__get_free_pages(THREAD_FLAGS, THREAD_ORDER)) + ((struct thread_info *)__alloc_vcompound(THREAD_FLAGS, THREAD_ORDER)) -#define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER) +#define free_thread_info(ti) __free_vcompound(ti) #else /* !__ASSEMBLY__ */