Skip to contentSkip to conversation

mm: memory_hotplug: Remove unnecesary check from register_page_bootmem_info_section()

PATCH Applied Oscar Salvador 2 participants 2 messages Dec 5, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: memory_hotplug: Remove unnecesary check from register_page_bootmem_info_section()

When we call register_page_bootmem_info_section() having CONFIG_SPARSEMEM_VMEMMAP enabled, we check if the pfn is valid.
This check is redundant as we already checked this in register_page_bootmem_info_node() before calling register_page_bootmem_info_section(), so let's get rid of it.

---
 mm/memory_hotplug.c | 3 ---
 1 file changed, 3 deletions(-)
mm/memory_hotplug.c +0 -3
index d0856ab2f28d..7452a53b027f 100644
@@ -200,9 +200,6 @@ static void register_page_bootmem_info_section(unsigned long start_pfn)
 	struct mem_section *ms;
 	struct page *page, *memmap;
 
-	if (!pfn_valid(start_pfn))
-		return;
-
 	section_nr = pfn_to_section_nr(start_pfn);
 	ms = __nr_to_section(section_nr);
 
Signature · 7 lines
2.13.5

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Oscar Salvador

When we call register_page_bootmem_info_section() having CONFIG_SPARSEMEM_VMEMMAP enabled, we check if the pfn is valid.
This check is redundant as we already checked this in register_page_bootmem_info_node() before calling register_page_bootmem_info_section(), so let's get rid of it.

there is quite a lot of legacy and confused code in memory hotplug. Some of it is really subtle but this one is really straightforward

Quoted 1 line
Quoted 21 lines
---
 mm/memory_hotplug.c | 3 ---
 1 file changed, 3 deletions(-)
mm/memory_hotplug.c +0 -3
index d0856ab2f28d..7452a53b027f 100644
@@ -200,9 +200,6 @@ static void register_page_bootmem_info_section(unsigned long start_pfn)
 	struct mem_section *ms;
 	struct page *page, *memmap;
 
-	if (!pfn_valid(start_pfn))
-		return;
-
 	section_nr = pfn_to_section_nr(start_pfn);
 	ms = __nr_to_section(section_nr);
 
Signature · 1 line
2.13.5
Signature · 8 lines
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>