Merge tag 'nfsd-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
[linux-2.6-microblaze.git] / mm / sparse.c
index be7936e..120bc8e 100644 (file)
@@ -321,7 +321,8 @@ size_t mem_section_usage_size(void)
 static inline phys_addr_t pgdat_to_phys(struct pglist_data *pgdat)
 {
 #ifndef CONFIG_NUMA
-       return __pa_symbol(pgdat);
+       VM_BUG_ON(pgdat != &contig_page_data);
+       return __pa_symbol(&contig_page_data);
 #else
        return __pa(pgdat);
 #endif
@@ -435,8 +436,7 @@ struct page __init *__populate_section_memmap(unsigned long pfn,
        if (map)
                return map;
 
-       map = memblock_alloc_try_nid_raw(size, size, addr,
-                                         MEMBLOCK_ALLOC_ACCESSIBLE, nid);
+       map = memmap_alloc(size, size, addr, nid, false);
        if (!map)
                panic("%s: Failed to allocate %lu bytes align=0x%lx nid=%d from=%pa\n",
                      __func__, size, PAGE_SIZE, nid, &addr);
@@ -463,8 +463,7 @@ static void __init sparse_buffer_init(unsigned long size, int nid)
         * and we want it to be properly aligned to the section size - this is
         * especially the case for VMEMMAP which maps memmap to PMDs
         */
-       sparsemap_buf = memblock_alloc_exact_nid_raw(size, section_map_size(),
-                                       addr, MEMBLOCK_ALLOC_ACCESSIBLE, nid);
+       sparsemap_buf = memmap_alloc(size, section_map_size(), addr, nid, true);
        sparsemap_buf_end = sparsemap_buf + size;
 }