[PATCH] [rmap] upper limit on wait table size

William Lee Irwin III (wli@holomorphy.com)
Sun, 17 Feb 2002 02:20:13 -0800


# This is a BitKeeper generated patch for the following project:
# Project Name: Long-term Linux VM development
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.201 ->
# mm/page_alloc.c 1.60 -> 1.61
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/02/17 wli@holomorphy.com 1.202
# Set upper limits on the maximum number of waitqueue table entries.
# --------------------------------------------
#
diff -Nru a/mm/page_alloc.c b/mm/page_alloc.c
--- a/mm/page_alloc.c Sun Feb 17 02:15:31 2002
+++ b/mm/page_alloc.c Sun Feb 17 02:15:31 2002
@@ -825,6 +825,22 @@
while(size < pages)
size <<= 1;

+ /*
+ * 16384 blocked kernel threads seems like a reasonable
+ * number and this throttles the growth of the wait table
+ * to something bounded above by something resembling
+ * approximately the maximum number of kernel threads
+ * expected. This limit will trigger at 16K*4K*256 = 16GB
+ * on i386. The hard upper bound for i386 is then
+ * 16K*12B = 192KB, which is large but acceptable. For
+ * uniprocessor machines 4096 threads is a more likely
+ * number. i386 UP triggers this at 4GB for a 48KB table.
+ */
+ if (NR_CPUS > 1)
+ size = min(size, 16384UL);
+ else
+ size = min(size, 4096UL);
+
return size;
}

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