Commit 5ef097dd authored by Michael Neuling's avatar Michael Neuling Committed by Linus Torvalds

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: default avatarMichael Neuling <mikey@neuling.org>
Cc: Helge Deller <deller@gmx.de>
Reviewed-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Americo Wang <xiyou.wangcong@gmail.com>
Cc: Anton Blanchard <anton@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9728e5d6
...@@ -556,8 +556,6 @@ static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift) ...@@ -556,8 +556,6 @@ static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift)
return 0; return 0;
} }
#define EXTRA_STACK_VM_PAGES 20 /* random */
/* /*
* Finalizes the stack vm_area_struct. The flags and permissions are updated, * Finalizes the stack vm_area_struct. The flags and permissions are updated,
* the stack is optionally relocated, and some extra space is added. * the stack is optionally relocated, and some extra space is added.
...@@ -632,7 +630,7 @@ int setup_arg_pages(struct linux_binprm *bprm, ...@@ -632,7 +630,7 @@ int setup_arg_pages(struct linux_binprm *bprm,
goto out_unlock; goto out_unlock;
} }
stack_expand = EXTRA_STACK_VM_PAGES * PAGE_SIZE; stack_expand = 131072UL; /* randomly 32*4k (or 2*64k) pages */
stack_size = vma->vm_end - vma->vm_start; stack_size = vma->vm_end - vma->vm_start;
/* /*
* Align this down to a page boundary as expand_stack * Align this down to a page boundary as expand_stack
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment