Skip to content

Commit d09b013

Browse files
yishimatsutorvalds
authored andcommitted
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: 815121d ("memory_hotplug: clear zone when removing the memory") Link: http://lkml.kernel.org/r/d9d5593a-d0a4-c4be-ab08-493df59a85c6@gmail.com Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Xishi Qiu <qiuxishi@huawei.com> Cc: Reza Arbab <arbab@linux.vnet.ibm.com> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 1dd2bfc commit d09b013

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎mm/memory_hotplug.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ EXPORT_SYMBOL_GPL(__add_pages);
338338

339339
#ifdef CONFIG_MEMORY_HOTREMOVE
340340
/* find the smallest valid pfn in the range [start_pfn, end_pfn) */
341-
static int find_smallest_section_pfn(int nid, struct zone *zone,
341+
static unsigned long find_smallest_section_pfn(int nid, struct zone *zone,
342342
unsigned long start_pfn,
343343
unsigned long end_pfn)
344344
{
@@ -363,7 +363,7 @@ static int find_smallest_section_pfn(int nid, struct zone *zone,
363363
}
364364

365365
/* find the biggest valid pfn in the range [start_pfn, end_pfn). */
366-
static int find_biggest_section_pfn(int nid, struct zone *zone,
366+
static unsigned long find_biggest_section_pfn(int nid, struct zone *zone,
367367
unsigned long start_pfn,
368368
unsigned long end_pfn)
369369
{

0 commit comments

Comments
 (0)