[PATCH] shrink core hashes on small systems

From: Matt Mackall
Date: Mon Apr 05 2004 - 15:51:12 EST


Shrink hashes on small systems

Tweak vfs_caches_init logic so that hashes don't start growing as
quickly on small systems.


tiny-mpm/init/main.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletion(-)

diff -puN init/main.c~hash-sizes init/main.c
--- tiny/init/main.c~hash-sizes 2004-03-20 12:14:43.000000000 -0600
+++ tiny-mpm/init/main.c 2004-03-20 12:14:43.000000000 -0600
@@ -470,7 +470,9 @@ asmlinkage void __init start_kernel(void
buffer_init();
unnamed_dev_init();
security_scaffolding_startup();
- vfs_caches_init(num_physpages);
+ /* Treat machines smaller than 6M as having 2M of memory
+ for hash-sizing purposes */
+ vfs_caches_init(max(500, (int)num_physpages-1000));
radix_tree_init();
signals_init();
/* rootfs populating might need page-writeback */

_


--
Matt Mackall : http://www.selenic.com : Linux development and consulting
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/