lkml.org 
[lkml]   [2010]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] Create initial stack independent of PAGE_SIZE
Date
> Currently we create the initial stack based on the PAGE_SIZE.  This is
> unnecessary.

I don't think this is enough explanation. In past mail, you described
why page size dependency is harmful. I hope you add it into the patch
description.

IOW, we don't need to change the unnecessary-but-non-harmful behavior.

>
> 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.

Why do we need page-aligning? Do you mean this code doesn't works on
128K (or more larger) page systems?


>
> Signed-off-by: Michael Neuling <mikey@neuling.org>
> ---
> This is the second half of my original patch. This can be targeted for
> 2.6.34 as it's just a cleanup.
>
> Tested on PPC64 with 4k and 64k pages.
>
> fs/exec.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> Index: linux-2.6-ozlabs/fs/exec.c
> ===================================================================
> --- linux-2.6-ozlabs.orig/fs/exec.c
> +++ linux-2.6-ozlabs/fs/exec.c
> @@ -554,8 +554,6 @@ static int shift_arg_pages(struct vm_are
> return 0;
> }
>
> -#define EXTRA_STACK_VM_PAGES 20 /* random */
> -
> /*
> * Finalizes the stack vm_area_struct. The flags and permissions are updated,
> * the stack is optionally relocated, and some extra space is added.
> @@ -630,7 +628,7 @@ int setup_arg_pages(struct linux_binprm
> 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;
> /*
> * Align this down to a page boundary as expand_stack





\
 
 \ /
  Last update: 2010-02-12 08:23    [W:0.289 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site