kernel-ark/init
Heinrich Schuchardt ff691f6e03 kernel/fork.c: new function for max_threads
PAGE_SIZE is not guaranteed to be equal to or less than 8 times the
THREAD_SIZE.

E.g.  architecture hexagon may have page size 1M and thread size 4096.
This would lead to a division by zero in the calculation of max_threads.

With this patch the buggy code is moved to a separate function
set_max_threads.  The error is not fixed.

After fixing the problem in a separate patch the new function can be
reused to adjust max_threads after adding or removing memory.

Argument mempages of function fork_init() is removed as totalram_pages is
an exported symbol.

The creation of separate patches for refactoring to a new function and for
fixing the logic was suggested by Ingo Molnar.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-04-17 09:04:06 -04:00
..
calibrate.c
do_mounts_initrd.c
do_mounts_md.c
do_mounts_rd.c initramfs: support initramfs that is bigger than 2GiB 2014-08-08 15:57:26 -07:00
do_mounts.c init: fix read-write root mount 2014-12-17 08:27:14 -05:00
do_mounts.h
init_task.c
initramfs.c init/initramfs.c: resolve shadow warnings 2014-10-14 02:18:22 +02:00
Kconfig kernel: conditionally support non-root users, groups and capabilities 2015-04-15 16:35:22 -07:00
main.c kernel/fork.c: new function for max_threads 2015-04-17 09:04:06 -04:00
Makefile
noinitramfs.c
version.c copy address of proc_ns_ops into ns_common 2014-12-04 14:34:47 -05:00