lkml.org 
[lkml]   [2003]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH] use NODES_SHIFT to calculate ZONE_SHIFT
From
Now that we have a proper NODES_SHIFT value, we need to use it to define
ZONE_SHIFT otherwise we'll spill over 8 bits if we have more than 85
nodes. How does this look? The '+2' should really be
log2(MAX_NR_NODES), but I think this is an improvement over what was
there.

Thanks,
Jesse

===== include/linux/mm.h 1.133 vs edited =====
--- 1.133/include/linux/mm.h Sun Oct 5 01:07:49 2003
+++ edited/include/linux/mm.h Tue Nov 4 16:45:33 2003
@@ -322,8 +322,10 @@
/*
* The zone field is never updated after free_area_init_core()
* sets it, so none of the operations on it need to be atomic.
+ * We'll have up to log2(MAX_NUMNODES * MAX_NR_ZONES) zones
+ * total, so we use NODES_SHIFT here to get enough bits.
*/
-#define ZONE_SHIFT (BITS_PER_LONG - 8)
+#define ZONE_SHIFT (BITS_PER_LONG - (NODES_SHIFT + 2))

struct zone;
extern struct zone *zone_table[];
-
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/
\
 
 \ /
  Last update: 2005-03-22 13:58    [W:0.038 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site