Merge nommu tree
[sfrench/cifs-2.6.git] / arch / x86_64 / mm / srat.c
index cd25300726fc7ac184009b3cf926f758eeb4c1bb..2eb879590dc42107bd4fc0ef7a4019d1617e7055 100644 (file)
@@ -23,7 +23,7 @@ static struct acpi_table_slit *acpi_slit;
 
 static nodemask_t nodes_parsed __initdata;
 static nodemask_t nodes_found __initdata;
-static struct node nodes[MAX_NUMNODES] __initdata;
+static struct bootnode nodes[MAX_NUMNODES] __initdata;
 static u8 pxm2node[256] = { [0 ... 255] = 0xff };
 
 /* Too small nodes confuse the VM badly. Usually they result
@@ -57,7 +57,7 @@ static __init int conflicting_nodes(unsigned long start, unsigned long end)
 {
        int i;
        for_each_node_mask(i, nodes_parsed) {
-               struct node *nd = &nodes[i];
+               struct bootnode *nd = &nodes[i];
                if (nd->start == nd->end)
                        continue;
                if (nd->end > start && nd->start < end)
@@ -70,7 +70,7 @@ static __init int conflicting_nodes(unsigned long start, unsigned long end)
 
 static __init void cutoff_node(int i, unsigned long start, unsigned long end)
 {
-       struct node *nd = &nodes[i];
+       struct bootnode *nd = &nodes[i];
        if (nd->start < start) {
                nd->start = start;
                if (nd->end < nd->start)
@@ -159,7 +159,7 @@ acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa)
 void __init
 acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
 {
-       struct node *nd;
+       struct bootnode *nd;
        unsigned long start, end;
        int node, pxm;
        int i;
@@ -228,7 +228,8 @@ static int nodes_cover_memory(void)
        }
 
        e820ram = end_pfn - e820_hole_size(0, end_pfn);
-       if (pxmram < e820ram) {
+       /* We seem to lose 3 pages somewhere. Allow a bit of slack. */
+       if ((long)(e820ram - pxmram) >= 1*1024*1024) {
                printk(KERN_ERR
        "SRAT: PXMs only cover %luMB of your %luMB e820 RAM. Not used.\n",
                        (pxmram << PAGE_SHIFT) >> 20,
@@ -270,7 +271,7 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
                return -1;
        }
 
-       memnode_shift = compute_hash_shift(nodes, nodes_weight(nodes_parsed));
+       memnode_shift = compute_hash_shift(nodes, MAX_NUMNODES);
        if (memnode_shift < 0) {
                printk(KERN_ERR
                     "SRAT: No NUMA node hash function found. Contact maintainer\n");