summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorNick Piggin <nickpiggin@yahoo.com.au>2004-08-30 20:35:49 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-30 20:35:49 -0700
commit2c05d9eb31eac02a105f2b05c144272f8b382864 (patch)
tree0f89e12ad1824ae293c2cdead03912f810c7c89b /include/linux
parent497c9d6819e984f737ff51489258f213e193d52e (diff)
[PATCH] fix PID hash sizing
A 4GB, 4-way Opteron would create the smallest size table (16 entries) because pidhash_init is called before mem_init which is where x86-64 sets up max_pfn. nr_kernel_pages is setup by paging_init, called from setup_arch, which is also where i386 sets up max_pfn. So export nr_kernel_pages, nr_all_pages. Use nr_kernel_pages when sizing the PID hash. This fixes the problem. This also makes the pid hash dependant on the size of ZONE_NORMAL instead of total size of memory. Signed-off-by: Nick Piggin <nickpiggin@yahoo.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bootmem.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index e038f9a3d0ef..376a5500a7a6 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -67,6 +67,9 @@ extern void * __init __alloc_bootmem_node (pg_data_t *pgdat, unsigned long size,
__alloc_bootmem_node((pgdat), (x), PAGE_SIZE, 0)
#endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */
+extern unsigned long __initdata nr_kernel_pages;
+extern unsigned long __initdata nr_all_pages;
+
extern void *__init alloc_large_system_hash(const char *tablename,
unsigned long bucketsize,
unsigned long numentries,