]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-x86_64/mmzone.h
[PATCH] x86-64: Allocate the NUMA hash function nodemap dynamically
[linux-2.6-omap-h63xx.git] / include / asm-x86_64 / mmzone.h
index c38ebdf6f426ad41ddfc19fc8df42553eae4b5a6..39ef106986eb78829e0aab1542aef151807c6139 100644 (file)
 
 #include <asm/smp.h>
 
-/* Should really switch to dynamic allocation at some point */
-#define NODEMAPSIZE 0x4fff
-
 /* Simple perfect hash to map physical addresses to node numbers */
 struct memnode {
        int shift;
-       u8 map[NODEMAPSIZE];
-} ____cacheline_aligned;
+       unsigned int mapsize;
+       u8 *map;
+       u8 embedded_map[64-16];
+} ____cacheline_aligned; /* total size = 64 bytes */
 extern struct memnode memnode;
 #define memnode_shift memnode.shift
 #define memnodemap memnode.map
+#define memnodemapsize memnode.mapsize
 
 extern struct pglist_data *node_data[];
 
 static inline __attribute__((pure)) int phys_to_nid(unsigned long addr) 
 { 
        unsigned nid; 
-       VIRTUAL_BUG_ON((addr >> memnode_shift) >= NODEMAPSIZE);
+       VIRTUAL_BUG_ON(!memnodemap);
+       VIRTUAL_BUG_ON((addr >> memnode_shift) >= memnodemapsize);
        nid = memnodemap[addr >> memnode_shift]; 
        VIRTUAL_BUG_ON(nid >= MAX_NUMNODES || !node_data[nid]); 
        return nid;