mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
mm/sparse: remove section_map_size()
section_map_size() no longer provides any shared logic. After the sparse-vmemmap changes, its only remaining user is the !CONFIG_SPARSEMEM_VMEMMAP path in __populate_section_memmap(), which can compute the size inline with PAGE_ALIGN(sizeof(struct page) * PAGES_PER_SECTION). Remove section_map_size() and inline the remaining calculation. Link: https://lore.kernel.org/20260910063256.64386-14-songmuchun@bytedance.com Signed-off-by: Muchun Song <songmuchun@bytedance.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Acked-by: David Hildenbrand (Arm) <david@kernel.org> Cc: David Laight <david.laight.linux@gmail.com> Cc: Liam R. Howlett <liam@infradead.org> Cc: Lorenzo Stoakes <ljs@kernel.org> Cc: Michal Hocko <mhocko@suse.com> Cc: Oscar Salvador <osalvador@suse.de> Cc: Qi Zheng <qi.zheng@linux.dev> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Vlastimil Babka <vbabka@kernel.org>
This commit is contained in:
parent
1269621f9a
commit
7d55d0a118
|
|
@ -5140,7 +5140,6 @@ static inline void print_vma_addr(char *prefix, unsigned long rip)
|
|||
}
|
||||
#endif
|
||||
|
||||
unsigned long section_map_size(void);
|
||||
struct page * __populate_section_memmap(unsigned long pfn,
|
||||
unsigned long nr_pages, int nid, struct vmem_altmap *altmap,
|
||||
struct dev_pagemap *pgmap);
|
||||
|
|
|
|||
15
mm/sparse.c
15
mm/sparse.c
|
|
@ -208,23 +208,12 @@ void __init sparse_sections_init(void)
|
|||
memory_present(nid, start, end);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SPARSEMEM_VMEMMAP
|
||||
unsigned long __init section_map_size(void)
|
||||
{
|
||||
return ALIGN(sizeof(struct page) * PAGES_PER_SECTION, PMD_SIZE);
|
||||
}
|
||||
|
||||
#else
|
||||
unsigned long __init section_map_size(void)
|
||||
{
|
||||
return PAGE_ALIGN(sizeof(struct page) * PAGES_PER_SECTION);
|
||||
}
|
||||
|
||||
#ifndef CONFIG_SPARSEMEM_VMEMMAP
|
||||
struct page __init *__populate_section_memmap(unsigned long pfn,
|
||||
unsigned long nr_pages, int nid, struct vmem_altmap *altmap,
|
||||
struct dev_pagemap *pgmap)
|
||||
{
|
||||
unsigned long size = section_map_size();
|
||||
const unsigned long size = PAGE_ALIGN(sizeof(struct page) * PAGES_PER_SECTION);
|
||||
|
||||
return memmap_alloc(size, size, __pa(MAX_DMA_ADDRESS), nid, false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user