From 86ec4f2cdea22615f9819f95df670da4090a2b94 Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Sun, 22 Feb 2009 01:50:06 +0000 Subject: [PATCH] --- yaml --- r: 138496 b: refs/heads/master c: 002b0ec73dd8b784004e5a013ad9f2fa6274af5a h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/powerpc/mm/mmap.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 2511f4e806e8..1b3feddf0307 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a5adc91a4b44b5d1706b9d906cc14fe4f312afe9 +refs/heads/master: 002b0ec73dd8b784004e5a013ad9f2fa6274af5a diff --git a/trunk/arch/powerpc/mm/mmap.c b/trunk/arch/powerpc/mm/mmap.c index 75dc7faaf917..0d957a4c70fe 100644 --- a/trunk/arch/powerpc/mm/mmap.c +++ b/trunk/arch/powerpc/mm/mmap.c @@ -30,9 +30,16 @@ /* * Top of mmap area (just below the process stack). * - * Leave an at least ~128 MB hole. + * Leave at least a ~128 MB hole on 32bit applications. + * + * On 64bit applications we randomise the stack by 1GB so we need to + * space our mmap start address by a further 1GB, otherwise there is a + * chance the mmap area will end up closer to the stack than our ulimit + * requires. */ -#define MIN_GAP (128*1024*1024) +#define MIN_GAP32 (128*1024*1024) +#define MIN_GAP64 ((128 + 1024)*1024*1024UL) +#define MIN_GAP ((is_32bit_task()) ? MIN_GAP32 : MIN_GAP64) #define MAX_GAP (TASK_SIZE/6*5) static inline int mmap_is_legacy(void)