From patchwork Fri May 2 11:54:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hogan X-Patchwork-Id: 4101771 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 308589F467 for ; Fri, 2 May 2014 11:54:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9E96720303 for ; Fri, 2 May 2014 11:54:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0976120306 for ; Fri, 2 May 2014 11:54:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752148AbaEBLy3 (ORCPT ); Fri, 2 May 2014 07:54:29 -0400 Received: from [217.156.133.130] ([217.156.133.130]:15883 "EHLO imgpgp01.kl.imgtec.org" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751733AbaEBLy1 (ORCPT ); Fri, 2 May 2014 07:54:27 -0400 Received: from imgpgp01.kl.imgtec.org (imgpgp01.kl.imgtec.org [127.0.0.1]) by imgpgp01.kl.imgtec.org (PGP Universal) with ESMTP id 628AF41F8E55; Fri, 2 May 2014 12:54:26 +0100 (BST) Received: from mailapp01.imgtec.com ([10.100.180.241]) by imgpgp01.kl.imgtec.org (PGP Universal service); Fri, 02 May 2014 12:54:26 +0100 X-PGP-Universal: processed; by imgpgp01.kl.imgtec.org on Fri, 02 May 2014 12:54:26 +0100 Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id DC095FBA4B9B3; Fri, 2 May 2014 12:54:23 +0100 (IST) Received: from LEMAIL01.le.imgtec.org (192.168.152.62) by KLMAIL01.kl.imgtec.org (192.168.5.35) with Microsoft SMTP Server (TLS) id 14.3.181.6; Fri, 2 May 2014 12:54:26 +0100 Received: from [192.168.154.101] (192.168.154.101) by LEMAIL01.le.imgtec.org (192.168.152.62) with Microsoft SMTP Server (TLS) id 14.3.174.1; Fri, 2 May 2014 12:54:25 +0100 Message-ID: <5363876A.2030709@imgtec.com> Date: Fri, 2 May 2014 12:54:18 +0100 From: James Hogan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: James Bottomley , Helge Deller CC: , , "John David Anglin" , Subject: Re: [PATCH] parisc,metag: Do not hardcode maximum userspace stack size References: <20140430212602.GA20601@p100.fritz.box> <53622DBA.807@imgtec.com> <1398966636.2174.21.camel@dabdike> In-Reply-To: <1398966636.2174.21.camel@dabdike> X-Enigmail-Version: 1.6 X-Originating-IP: [192.168.154.101] X-ESG-ENCRYPT-TAG: 96d62635 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 01/05/14 18:50, James Bottomley wrote: > >> + >> +config MAX_STACK_SIZE_MB >> + int "Maximum user stack size (MB)" >> + default 80 >> + range 8 256 if METAG >> + range 8 2048 >> + depends on STACK_GROWSUP >> + help >> + This is the maximum stack size in Megabytes in the VM layout of user >> + processes when the stack grows upwards (currently only on parisc and >> + metag arch). The stack will be located at the highest memory address >> + minus the given value, unless the RLIMIT_STACK hard limit is changed >> + to a smaller value in which case that is used. >> + >> + A sane initial value is 80 MB. > > There's one final issue with this: placement of the stack only really > matters on 32 bits. We have three expanding memory areas: stack, heap > and maps. On 64 bits these are placed well separated from each other on > 64 bits, so an artificial limit like this doesn't matter. Does the following fixup diff look reasonable? It forces MAX_STACK_SIZE_MB to 1024 and hides the Kconfig option for 64BIT, effectively leaving the behaviour unchanged in that case. Thanks James diff --git a/mm/Kconfig b/mm/Kconfig index e80075979530..b0307f737bd7 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -583,7 +583,8 @@ config GENERIC_EARLY_IOREMAP bool config MAX_STACK_SIZE_MB - int "Maximum user stack size (MB)" + int "Maximum user stack size (MB)" if !64BIT + default 1024 if 64BIT default 80 range 8 256 if METAG range 8 2048