The hash_long function in <linux/hash.h> returns bogus results for size
1 hashtables, and wait-queue hashtables can reach that limit for
small-memory systems, so this patch makes the minimum size 4.
This fix was suggested by Andrew Morton.
diff -ruN -X../cludes ../orig/linux-2.5.50-uc0/mm/page_alloc.c mm/page_alloc.c
--- ../orig/linux-2.5.50-uc0/mm/page_alloc.c 2002-11-25 10:30:10.000000000 +0900
+++ mm/page_alloc.c 2002-12-09 11:33:33.000000000 +0900
@@ -961,7 +961,9 @@
*/
size = min(size, 4096UL);
- return size;
+ /* The `hash_long' function can't handle tables of size 1, so make
+ sure we don't create one. */
+ return max(size, 4UL);
}
/*