[PATCH 1/2] GFP_ZONETYPES add commentry on how to calculate

From: Andy Whitcroft
Date: Thu Jan 19 2006 - 16:52:33 EST


GFP_ZONETYPES define using GFP_ZONEMASK and add commentry

Add commentry explaining the optimisation that we can apply to
GFP_ZONETYPES when the lest most bit is a 'loaner', it can only be
set in isolation.

Signed-off-by: Andy Whitcroft <apw@xxxxxxxxxxxx>
---
mmzone.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff -upN reference/include/linux/mmzone.h current/include/linux/mmzone.h
--- reference/include/linux/mmzone.h
+++ current/include/linux/mmzone.h
@@ -91,6 +91,14 @@ struct per_cpu_pageset {
* be 8 (2 ** 3) zonelists. GFP_ZONETYPES defines the number of possible
* combinations of zone modifiers in "zone modifier space".
*
+ * As an optimisation any zone modifier bits which are only valid when
+ * no other zone modifier bits are set (loners) should be placed in
+ * the highest order bits of this field. This allows us to reduce the
+ * extent of the zonelists thus saving space. For example in the case
+ * of three zone modifier bits, we could require up to eight zonelists.
+ * If the left most zone modifier is a "loner" then the highest valid
+ * zonelist would be four allowing us to allocate only five zonelists.
+ *
* NOTE! Make sure this matches the zones in <linux/gfp.h>
*/
#define GFP_ZONEMASK 0x07
-
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/