aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorAndrew Morton <akpm@digeo.com>2003-01-05 03:51:56 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2003-01-05 03:51:56 -0800
commit9a7dad1c87fc2ba65f2fdc745c69fd5500e04b09 (patch)
treed1271be9f3f9aded4cd5dfbdf3a98a3b5379da31 /init
parent148b113a1ce387227c23486631a1832422f312d9 (diff)
downloadhistory-9a7dad1c87fc2ba65f2fdc745c69fd5500e04b09.tar.gz
[PATCH] Dynamically size the pidhash hash table.
Patch from Bill Irwin. Prodding from me. The hashtables in kernel/pid.c are 128 kbytes, which is far too large for very small machines. So we dynamically size them and allocate them from bootmem. From 16 buckets on the very smallest machine up to 4096 buckets (effectively half the current size) with one gigabyte of memory or more. The patch also switches the hashing from a custom hash over to the more powerful hash_long().
Diffstat (limited to 'init')
-rw-r--r--init/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/init/main.c b/init/main.c
index b07fac4e9f02d9..51b822b9d03fb8 100644
--- a/init/main.c
+++ b/init/main.c
@@ -68,6 +68,7 @@ extern void sysctl_init(void);
extern void signals_init(void);
extern void buffer_init(void);
extern void pidhash_init(void);
+extern void pidmap_init(void);
extern void pte_chain_init(void);
extern void radix_tree_init(void);
extern void free_initmem(void);
@@ -394,6 +395,7 @@ asmlinkage void __init start_kernel(void)
extable_init();
rcu_init();
init_IRQ();
+ pidhash_init();
sched_init();
softirq_init();
time_init();
@@ -419,7 +421,7 @@ asmlinkage void __init start_kernel(void)
page_address_init();
mem_init();
kmem_cache_sizes_init();
- pidhash_init();
+ pidmap_init();
pgtable_cache_init();
pte_chain_init();
fork_init(num_physpages);