Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753352Ab0BLJvP (ORCPT ); Fri, 12 Feb 2010 04:51:15 -0500 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:49897 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752122Ab0BLJvO (ORCPT ); Fri, 12 Feb 2010 04:51:14 -0500 X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 From: KOSAKI Motohiro To: Michael Neuling Subject: Re: [PATCH] Create initial stack independent of PAGE_SIZE Cc: kosaki.motohiro@jp.fujitsu.com, Andrew Morton , Helge Deller , Americo Wang , Anton Blanchard , linux-kernel@vger.kernel.org In-Reply-To: <2593.1265965336@neuling.org> References: <20100212161305.73B2.A69D9226@jp.fujitsu.com> <2593.1265965336@neuling.org> Message-Id: <20100212184941.73BE.A69D9226@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.50.07 [ja] Date: Fri, 12 Feb 2010 18:51:09 +0900 (JST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2744 Lines: 90 > In message <20100212161305.73B2.A69D9226@jp.fujitsu.com> you wrote: > > > 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. > > I don't think it's harmful, it's just irrelevant. Stack size is > independent of page size. ok. > > 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? > > If the "random" setting is not a common multiple of the 4k and 64k > pages, they will end up getting aligned differently, hence causing what > we are trying to avoid in the first place with this patch. I see. ok, Reviewed-by: KOSAKI Motohiro > > I should probably add this as a comment in the code comment? probably, It's not big matter. Thanks :) > > Mikey > > > > > > > > > > > Signed-off-by: Michael Neuling > > > --- > > > 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 updat > ed, > > > * 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 > > > > > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/