Skip to content

Commit 79375ea

Browse files
committed
mm: remove obsolete alloc_remap()
Tile was the only remaining architecture to implement alloc_remap(), and since that is being removed, there is no point in keeping this function. Removing all callers simplifies the mem_map handling. Reviewed-by: Pavel Tatashin <pasha.tatashin@oracle.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent 1a84291 commit 79375ea

3 files changed

Lines changed: 1 addition & 28 deletions

File tree

‎include/linux/bootmem.h‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -364,15 +364,6 @@ static inline void __init memblock_free_late(
364364
}
365365
#endif /* defined(CONFIG_HAVE_MEMBLOCK) && defined(CONFIG_NO_BOOTMEM) */
366366

367-
#ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP
368-
extern void *alloc_remap(int nid, unsigned long size);
369-
#else
370-
static inline void *alloc_remap(int nid, unsigned long size)
371-
{
372-
return NULL;
373-
}
374-
#endif /* CONFIG_HAVE_ARCH_ALLOC_REMAP */
375-
376367
extern void *alloc_large_system_hash(const char *tablename,
377368
unsigned long bucketsize,
378369
unsigned long numentries,

‎mm/page_alloc.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6199,10 +6199,7 @@ static void __ref alloc_node_mem_map(struct pglist_data *pgdat)
61996199
end = pgdat_end_pfn(pgdat);
62006200
end = ALIGN(end, MAX_ORDER_NR_PAGES);
62016201
size = (end - start) * sizeof(struct page);
6202-
map = alloc_remap(pgdat->node_id, size);
6203-
if (!map)
6204-
map = memblock_virt_alloc_node_nopanic(size,
6205-
pgdat->node_id);
6202+
map = memblock_virt_alloc_node_nopanic(size, pgdat->node_id);
62066203
pgdat->node_mem_map = map + offset;
62076204
}
62086205
pr_debug("%s: node %d, pgdat %08lx, node_mem_map %08lx\n",

‎mm/sparse.c‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -427,10 +427,6 @@ struct page __init *sparse_mem_map_populate(unsigned long pnum, int nid,
427427
struct page *map;
428428
unsigned long size;
429429

430-
map = alloc_remap(nid, sizeof(struct page) * PAGES_PER_SECTION);
431-
if (map)
432-
return map;
433-
434430
size = PAGE_ALIGN(sizeof(struct page) * PAGES_PER_SECTION);
435431
map = memblock_virt_alloc_try_nid(size,
436432
PAGE_SIZE, __pa(MAX_DMA_ADDRESS),
@@ -446,17 +442,6 @@ void __init sparse_mem_maps_populate_node(struct page **map_map,
446442
unsigned long pnum;
447443
unsigned long size = sizeof(struct page) * PAGES_PER_SECTION;
448444

449-
map = alloc_remap(nodeid, size * map_count);
450-
if (map) {
451-
for (pnum = pnum_begin; pnum < pnum_end; pnum++) {
452-
if (!present_section_nr(pnum))
453-
continue;
454-
map_map[pnum] = map;
455-
map += size;
456-
}
457-
return;
458-
}
459-
460445
size = PAGE_ALIGN(size);
461446
map = memblock_virt_alloc_try_nid_raw(size * map_count,
462447
PAGE_SIZE, __pa(MAX_DMA_ADDRESS),

0 commit comments

Comments
 (0)