Skip to contentSkip to conversation

mm/memory_hotplug: define find_{smallest|biggest}_section_pfn as unsigned long

PATCH New [email protected] 1 participant 1 message Oct 3, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 44/51 mm/memory_hotplug: define find_{smallest|biggest}_section_pfn as unsigned long

From: YASUAKI ISHIMATSU <[email protected]>
Subject: mm/memory_hotplug: define find_{smallest|biggest}_section_pfn as unsigned long

find_{smallest|biggest}_section_pfn()s find the smallest/biggest section and return the pfn of the section. But the functions are defined as int. So the functions always return 0x00000000 - 0xffffffff. It means if memory address is over 16TB, the functions does not work correctly.

To handle 64 bit value, the patch defines find_{smallest|biggest}_section_pfn() as unsigned long.

Fixes 815121d2b5cd ("memory_hotplug: clear zone when removing the memory")
Cc Xishi Qiu <[email protected]>
Cc Reza Arbab <[email protected]>
Cc Vlastimil Babka <[email protected]>

---

 mm/memory_hotplug.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/memory_hotplug.c renamed from mm/memory_hotplug.c~mm-memory_hotplug-define-find_smallestbiggest_section_pfn-as-unsigned-long +2 -2
diff -puN mm/memory_hotplug.c~mm-memory_hotplug-define-find_smallestbiggest_section_pfn-as-unsigned-long mm/memory_hotplug.c
@@ -338,7 +338,7 @@ EXPORT_SYMBOL_GPL(__add_pages);
 
 #ifdef CONFIG_MEMORY_HOTREMOVE
 /* find the smallest valid pfn in the range [start_pfn, end_pfn) */
-static int find_smallest_section_pfn(int nid, struct zone *zone,
+static unsigned long find_smallest_section_pfn(int nid, struct zone *zone,
 				     unsigned long start_pfn,
 				     unsigned long end_pfn)
 {
@@ -363,7 +363,7 @@ static int find_smallest_section_pfn(int
 }
 
 /* find the biggest valid pfn in the range [start_pfn, end_pfn). */
-static int find_biggest_section_pfn(int nid, struct zone *zone,
+static unsigned long find_biggest_section_pfn(int nid, struct zone *zone,
 				    unsigned long start_pfn,
 				    unsigned long end_pfn)
 {

_