--- 25-akpm/fs/dcache.c | 6 ++---- 25-akpm/fs/inode.c | 6 ++---- net/ipv4/route.c | 0 net/ipv4/tcp.c | 0 4 files changed, 4 insertions(+), 8 deletions(-) diff -puN fs/dcache.c~limit-hash-table-sizes-boot-options-restore-defaults fs/dcache.c --- 25/fs/dcache.c~limit-hash-table-sizes-boot-options-restore-defaults Tue Feb 17 15:11:09 2004 +++ 25-akpm/fs/dcache.c Tue Feb 17 15:11:29 2004 @@ -49,7 +49,6 @@ static kmem_cache_t *dentry_cache; */ #define D_HASHBITS d_hash_shift #define D_HASHMASK d_hash_mask -#define D_HASHMAX (2*1024*1024UL) /* max number of entries */ static unsigned int d_hash_mask; static unsigned int d_hash_shift; @@ -1567,12 +1566,11 @@ static void __init dcache_init(unsigned set_shrinker(DEFAULT_SEEKS, shrink_dcache_memory); - if (!dhash_entries) { + if (!dhash_entries) dhash_entries = PAGE_SHIFT < 13 ? mempages >> (13 - PAGE_SHIFT) : mempages << (PAGE_SHIFT - 13); - dhash_entries = min(D_HASHMAX, dhash_entries); - } + dhash_entries *= sizeof(struct hlist_head); for (order = 0; ((1UL << order) << PAGE_SHIFT) < dhash_entries; order++) ; diff -puN fs/inode.c~limit-hash-table-sizes-boot-options-restore-defaults fs/inode.c --- 25/fs/inode.c~limit-hash-table-sizes-boot-options-restore-defaults Tue Feb 17 15:11:09 2004 +++ 25-akpm/fs/inode.c Tue Feb 17 15:11:47 2004 @@ -53,7 +53,6 @@ */ #define I_HASHBITS i_hash_shift #define I_HASHMASK i_hash_mask -#define I_HASHMAX (2*1024*1024UL) /* max number of entries */ static unsigned int i_hash_mask; static unsigned int i_hash_shift; @@ -1336,12 +1335,11 @@ void __init inode_init(unsigned long mem for (i = 0; i < ARRAY_SIZE(i_wait_queue_heads); i++) init_waitqueue_head(&i_wait_queue_heads[i].wqh); - if (!ihash_entries) { + if (!ihash_entries) ihash_entries = PAGE_SHIFT < 14 ? mempages >> (14 - PAGE_SHIFT) : mempages << (PAGE_SHIFT - 14); - ihash_entries = min(I_HASHMAX, ihash_entries); - } + ihash_entries *= sizeof(struct hlist_head); for (order = 0; ((1UL << order) << PAGE_SHIFT) < ihash_entries; order++) ; diff -puN net/ipv4/route.c~limit-hash-table-sizes-boot-options-restore-defaults net/ipv4/route.c diff -puN net/ipv4/tcp.c~limit-hash-table-sizes-boot-options-restore-defaults net/ipv4/tcp.c _