Skip to content

Commit

Permalink
mm: kill find_min_pfn_with_active_regions()
Browse files Browse the repository at this point in the history
find_min_pfn_with_active_regions() is only called from free_area_init(). 
Open-code the PHYS_PFN(memblock_start_of_DRAM()) into free_area_init(),
and kill find_min_pfn_with_active_regions().

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Kefeng Wang <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Kefeng Wang authored and akpm00 committed Sep 12, 2022
1 parent 0192445 commit fb70c48
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
1 change: 0 additions & 1 deletion include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -2520,7 +2520,6 @@ extern unsigned long absent_pages_in_range(unsigned long start_pfn,
unsigned long end_pfn);
extern void get_pfn_range_for_nid(unsigned int nid,
unsigned long *start_pfn, unsigned long *end_pfn);
extern unsigned long find_min_pfn_with_active_regions(void);

#ifndef CONFIG_NUMA
static inline int early_pfn_to_nid(unsigned long pfn)
Expand Down
13 changes: 1 addition & 12 deletions mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -7908,17 +7908,6 @@ unsigned long __init node_map_pfn_alignment(void)
return ~accl_mask + 1;
}

/**
* find_min_pfn_with_active_regions - Find the minimum PFN registered
*
* Return: the minimum PFN based on information provided via
* memblock_set_node().
*/
unsigned long __init find_min_pfn_with_active_regions(void)
{
return PHYS_PFN(memblock_start_of_DRAM());
}

/*
* early_calculate_totalpages()
* Sum pages in active regions for movable zone.
Expand Down Expand Up @@ -8211,7 +8200,7 @@ void __init free_area_init(unsigned long *max_zone_pfn)
memset(arch_zone_highest_possible_pfn, 0,
sizeof(arch_zone_highest_possible_pfn));

start_pfn = find_min_pfn_with_active_regions();
start_pfn = PHYS_PFN(memblock_start_of_DRAM());
descending = arch_has_descending_max_zone_pfns();

for (i = 0; i < MAX_NR_ZONES; i++) {
Expand Down

0 comments on commit fb70c48

Please sign in to comment.