parisc,metag: Do not hardcode maximum userspace stack size
authorHelge Deller <deller@gmx.de>
Wed, 30 Apr 2014 21:26:02 +0000 (23:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jul 2014 23:21:03 +0000 (16:21 -0700)
commit3ad0b55167a0a2cd4b13b917348aad3c5c8ee7c5
tree6cd1157af38005f38323a8ca4b5cd79fb83c475f
parent822c60a5f4eb9c84ece4bb4738335ec029733d44
parisc,metag: Do not hardcode maximum userspace stack size

commit 042d27acb64924a0e8a43e972485913a32407beb upstream.

This patch affects only architectures where the stack grows upwards
(currently parisc and metag only). On those do not hardcode the maximum
initial stack size to 1GB for 32-bit processes, but make it configurable
via a config option.

The main problem with the hardcoded stack size is, that we have two
memory regions which grow upwards: stack and heap. To keep most of the
memory available for heap in a flexmap memory layout, it makes no sense
to hard allocate up to 1GB of the memory for stack which can't be used
as heap then.

This patch makes the stack size for 32-bit processes configurable and
uses 80MB as default value which has been in use during the last few
years on parisc and which hasn't showed any problems yet.

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: linux-parisc@vger.kernel.org
Cc: linux-metag@vger.kernel.org
Cc: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/metag/include/asm/processor.h
arch/parisc/include/asm/processor.h
arch/parisc/kernel/sys_parisc.c
mm/Kconfig