aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2010-03-05 16:42:57 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-06 14:26:33 -0500
commit5ef097dd7ba4eab8b4f0026d85fcef9fe23b821f (patch)
tree5d2e580897795b8eae278f7548799119ac4803a0 /fs/exec.c
parent9728e5d6e6c432ee8487c63ce6e479e2474d9945 (diff)
exec: create initial stack independent of PAGE_SIZE
Currently we create the initial stack based on the PAGE_SIZE. This is unnecessary. This creates this initial stack independent of the PAGE_SIZE. It also bumps up the number of 4k pages allocated from 20 to 32, to align with 64K page systems. Signed-off-by: Michael Neuling <mikey@neuling.org> Cc: Helge Deller <deller@gmx.de> Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Americo Wang <xiyou.wangcong@gmail.com> Cc: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 6348d79401de..da2b31dc4e1c 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -556,8 +556,6 @@ static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift)
556 return 0; 556 return 0;
557} 557}
558 558
559#define EXTRA_STACK_VM_PAGES 20 /* random */
560
561/* 559/*
562 * Finalizes the stack vm_area_struct. The flags and permissions are updated, 560 * Finalizes the stack vm_area_struct. The flags and permissions are updated,
563 * the stack is optionally relocated, and some extra space is added. 561 * the stack is optionally relocated, and some extra space is added.
@@ -632,7 +630,7 @@ int setup_arg_pages(struct linux_binprm *bprm,
632 goto out_unlock; 630 goto out_unlock;
633 } 631 }
634 632
635 stack_expand = EXTRA_STACK_VM_PAGES * PAGE_SIZE; 633 stack_expand = 131072UL; /* randomly 32*4k (or 2*64k) pages */
636 stack_size = vma->vm_end - vma->vm_start; 634 stack_size = vma->vm_end - vma->vm_start;
637 /* 635 /*
638 * Align this down to a page boundary as expand_stack 636 * Align this down to a page boundary as expand_stack