From 72680a191b934377430032f93af15ef50aafb3a8 Mon Sep 17 00:00:00 2001 From: Hedi Berriche Date: Wed, 26 May 2010 14:44:06 -0700 Subject: pids: increase pid_max based on num_possible_cpus On a system with a substantial number of processors, the early default pid_max of 32k will not be enough. A system with 1664 CPU's, there are 25163 processes started before the login prompt. It's estimated that with 2048 CPU's we will pass the 32k limit. With 4096, we'll reach that limit very early during the boot cycle, and processes would stall waiting for an available pid. This patch increases the early maximum number of pids available, and increases the minimum number of pids that can be set during runtime. [akpm@linux-foundation.org: fix warnings] Signed-off-by: Hedi Berriche Signed-off-by: Mike Travis Signed-off-by: Robin Holt Acked-by: Linus Torvalds Cc: Ingo Molnar Cc: Pavel Machek Cc: Alan Cox Cc: Greg KH Cc: Rik van Riel Cc: John Stoffel Cc: Jack Steiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/threads.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/linux/threads.h') diff --git a/include/linux/threads.h b/include/linux/threads.h index 052b12bec8b..383ab9592be 100644 --- a/include/linux/threads.h +++ b/include/linux/threads.h @@ -33,4 +33,13 @@ #define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \ (sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT)) +/* + * Define a minimum number of pids per cpu. Heuristically based + * on original pid max of 32k for 32 cpus. Also, increase the + * minimum settable value for pid_max on the running system based + * on similar defaults. See kernel/pid.c:pidmap_init() for details. + */ +#define PIDS_PER_CPU_DEFAULT 1024 +#define PIDS_PER_CPU_MIN 8 + #endif -- cgit v1.2.3-70-g09d2