mm: define memblock_virt_alloc_try_nid_raw
[sfrench/cifs-2.6.git] / mm / page_alloc.c
index 4dee5082d3d735607ab5733433ef696f0e8c8518..805f30dd1c26ef3755b485b5452c589c0e00493d 100644 (file)
@@ -7313,18 +7313,17 @@ void *__init alloc_large_system_hash(const char *tablename,
 
        log2qty = ilog2(numentries);
 
-       /*
-        * memblock allocator returns zeroed memory already, so HASH_ZERO is
-        * currently not used when HASH_EARLY is specified.
-        */
        gfp_flags = (flags & HASH_ZERO) ? GFP_ATOMIC | __GFP_ZERO : GFP_ATOMIC;
        do {
                size = bucketsize << log2qty;
-               if (flags & HASH_EARLY)
-                       table = memblock_virt_alloc_nopanic(size, 0);
-               else if (hashdist)
+               if (flags & HASH_EARLY) {
+                       if (flags & HASH_ZERO)
+                               table = memblock_virt_alloc_nopanic(size, 0);
+                       else
+                               table = memblock_virt_alloc_raw(size, 0);
+               } else if (hashdist) {
                        table = __vmalloc(size, gfp_flags, PAGE_KERNEL);
-               else {
+               else {
                        /*
                         * If bucketsize is not a power-of-two, we may free
                         * some pages at the end of hash table which