[patch] minimum buffer hash size set to 128k (even on 4mbyte machines)

Andrea Arcangeli (andrea@suse.de)
Fri, 29 Oct 1999 18:29:24 +0200 (CEST)


The buffer dynamic hash is forcing the hash to be 2**5 in size careless
about the memory size. 2**5 for a 4mbyte box is far too much. An order of
5 means 32000 buckets. Considering a perfect hash distribution to fill all
the buckets you should need 32mbyte of memory if the blocksize is 1k or
131mbyte of memory if the blocksize of the filesystem is 4k. While you
have only 4mbyte of memory. So 2.2.13 (and 2.2.14pre2) using a order of 5
is wasting lots of precious memory in low mem boxes.

As the plain current heuristic scales well there's no need of such bogus
fixed low limit at all. The minium level will continue to be 1024 buckets
(1 page of ram) for the very low memory configurations.

Fix against 2.2.14pre2:

--- 2.2.14pre2/fs/buffer.c Fri Oct 29 16:40:41 1999
+++ /tmp/buffer.c Fri Oct 29 18:20:12 1999
@@ -1512,7 +1512,7 @@
fsync times (ext2) manageable, is the following */

memory_size >>= 20;
- for (order = 5; (1UL << order) < memory_size; order++);
+ for (order = 0; (1UL << order) < memory_size; order++);

/* try to allocate something until we get it or we're asking
for something that is really too small */

Andrea

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/