NUMA: optimize detection of memory with no node id assigned by firmware
[linux-2.6-microblaze.git] / arch / x86 / mm / numa.c
index b29ceb1..adc497b 100644 (file)
@@ -449,37 +449,6 @@ int __node_distance(int from, int to)
 }
 EXPORT_SYMBOL(__node_distance);
 
-/*
- * Sanity check to catch more bad NUMA configurations (they are amazingly
- * common).  Make sure the nodes cover all memory.
- */
-static bool __init numa_meminfo_cover_memory(const struct numa_meminfo *mi)
-{
-       u64 numaram, e820ram;
-       int i;
-
-       numaram = 0;
-       for (i = 0; i < mi->nr_blks; i++) {
-               u64 s = mi->blk[i].start >> PAGE_SHIFT;
-               u64 e = mi->blk[i].end >> PAGE_SHIFT;
-               numaram += e - s;
-               numaram -= __absent_pages_in_range(mi->blk[i].nid, s, e);
-               if ((s64)numaram < 0)
-                       numaram = 0;
-       }
-
-       e820ram = max_pfn - absent_pages_in_range(0, max_pfn);
-
-       /* We seem to lose 3 pages somewhere. Allow 1M of slack. */
-       if ((s64)(e820ram - numaram) >= (1 << (20 - PAGE_SHIFT))) {
-               printk(KERN_ERR "NUMA: nodes only cover %LuMB of your %LuMB e820 RAM. Not used.\n",
-                      (numaram << PAGE_SHIFT) >> 20,
-                      (e820ram << PAGE_SHIFT) >> 20);
-               return false;
-       }
-       return true;
-}
-
 /*
  * Mark all currently memblock-reserved physical memory (which covers the
  * kernel's own memory ranges) as hot-unswappable.
@@ -585,7 +554,8 @@ static int __init numa_register_memblks(struct numa_meminfo *mi)
                        return -EINVAL;
                }
        }
-       if (!numa_meminfo_cover_memory(mi))
+
+       if (!memblock_validate_numa_coverage(SZ_1M))
                return -EINVAL;
 
        /* Finally register nodes. */