Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198814
b: refs/heads/master
c: 72680a1
h: refs/heads/master
v: v3
  • Loading branch information
Hedi Berriche authored and Linus Torvalds committed May 27, 2010
1 parent 2b9558b commit a13ae1f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bd4fb654e3a0d83ca8cb138c5e3e6e65407e119c
refs/heads/master: 72680a191b934377430032f93af15ef50aafb3a8
9 changes: 9 additions & 0 deletions trunk/include/linux/threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions trunk/kernel/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,13 @@ void __init pidhash_init(void)

void __init pidmap_init(void)
{
/* bump default and minimum pid_max based on number of cpus */
pid_max = min(pid_max_max, max_t(int, pid_max,
PIDS_PER_CPU_DEFAULT * num_possible_cpus()));
pid_max_min = max_t(int, pid_max_min,
PIDS_PER_CPU_MIN * num_possible_cpus());
pr_info("pid_max: default: %u minimum: %u\n", pid_max, pid_max_min);

init_pid_ns.pidmap[0].page = kzalloc(PAGE_SIZE, GFP_KERNEL);
/* Reserve PID 0. We never call free_pidmap(0) */
set_bit(0, init_pid_ns.pidmap[0].page);
Expand Down

0 comments on commit a13ae1f

Please sign in to comment.