linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: YASUAKI ISHIMATSU <yasu.isimatu@gmail.com>
To: linux-mm@kvack.org
Cc: Michal Hocko <mhocko@suse.com>,
	qiuxishi@huawei.com, arbab@linux.vnet.ibm.com, vbabka@suse.cz,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] mm/memory_hotplug: define find_{smallest|biggest}_section_pfn as unsigned long
Date: Fri, 15 Sep 2017 22:53:49 -0400	[thread overview]
Message-ID: <d9d5593a-d0a4-c4be-ab08-493df59a85c6@gmail.com> (raw)
In-Reply-To: <e643a387-e573-6bbf-d418-c60c8ee3d15e@gmail.com>

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.

Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
---
 mm/memory_hotplug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 38c3c37..120e45b 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -582,7 +582,7 @@ int __ref __add_pages(int nid, struct zone *zone, unsigned long phys_start_pfn,

 #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)
 {
@@ -607,7 +607,7 @@ static int find_smallest_section_pfn(int nid, struct zone *zone,
 }

 /* 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)
 {
-- 
1.8.3.1

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

  reply	other threads:[~2017-09-16  2:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-16  2:52 [PATCH 1/2] mm/memory_hotplug: Change pfn_to_section_nr/section_nr_to_pfn macro to inline function YASUAKI ISHIMATSU
2017-09-16  2:53 ` YASUAKI ISHIMATSU [this message]
2017-09-18  6:37   ` [PATCH 2/2] mm/memory_hotplug: define find_{smallest|biggest}_section_pfn as unsigned long Michal Hocko
2017-09-18  6:35 ` [PATCH 1/2] mm/memory_hotplug: Change pfn_to_section_nr/section_nr_to_pfn macro to inline function Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d9d5593a-d0a4-c4be-ab08-493df59a85c6@gmail.com \
    --to=yasu.isimatu@gmail.com \
    --cc=arbab@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=qiuxishi@huawei.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).