[rfc][patch 1/3] mm: Define NR_NODE_MEMBLKS unconditionally

Johannes Weiner
2008-05-05T09:59:39Z

[-- Attachment #1: nr_node_memblks.patch --]
[-- Type: text/plain, Size: 1196 bytes --]

Bootmem needs to work on contiguous memory block quantities rather
than whole nodes, for the latter may overlap. So make this maxium
number and the resulting number of blocks per node available to
generic code like bootmem.

Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
---

Index: linux-2.6/include/linux/numa.h
===================================================================
--- linux-2.6.orig/include/linux/numa.h
+++ linux-2.6/include/linux/numa.h
@@ -1,13 +1,17 @@
#ifndef _LINUX_NUMA_H
#define _LINUX_NUMA_H

-
#ifdef CONFIG_NODES_SHIFT
-#define NODES_SHIFT CONFIG_NODES_SHIFT
+#define NODES_SHIFT CONFIG_NODES_SHIFT
#else
-#define NODES_SHIFT 0
+#define NODES_SHIFT 0
#endif

-#define MAX_NUMNODES (1 << NODES_SHIFT)
+#define MAX_NUMNODES (1 << NODES_SHIFT)
+
+#ifndef NR_NODE_MEMBLKS
+#define NR_NODE_MEMBLKS MAX_NUMNODES
+#endif
+#define NR_MEMBLKS_PER_NODE (NR_NODE_MEMBLKS / MAX_NUMNODES)

#endif /* _LINUX_NUMA_H */