Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1733194 > unrolled thread

[PATCH 2/2] mm/memory_hotplug: define find_{smallest|biggest}_section_pfn as unsigned long

Started byYASUAKI ISHIMATSU <yasu.isimatu@gmail.com>
First post2017-09-16 05:00 +0200
Last post2017-09-18 08:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/2] mm/memory_hotplug: define  find_{smallest|biggest}_section_pfn as unsigned long YASUAKI ISHIMATSU <yasu.isimatu@gmail.com> - 2017-09-16 05:00 +0200
    Re: [PATCH 2/2] mm/memory_hotplug: define  find_{smallest|biggest}_section_pfn as unsigned long Michal Hocko <mhocko@kernel.org> - 2017-09-18 08:40 +0200

#1733194 — [PATCH 2/2] mm/memory_hotplug: define find_{smallest|biggest}_section_pfn as unsigned long

FromYASUAKI ISHIMATSU <yasu.isimatu@gmail.com>
Date2017-09-16 05:00 +0200
Subject[PATCH 2/2] mm/memory_hotplug: define find_{smallest|biggest}_section_pfn as unsigned long
Message-ID<uqbuO-3H9-5@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1733669

FromMichal Hocko <mhocko@kernel.org>
Date2017-09-18 08:40 +0200
Message-ID<uqXSO-2ds-13@gated-at.bofh.it>
In reply to#1733194
On Fri 15-09-17 22:53:49, YASUAKI ISHIMATSU wrote:
> 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")
> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>

Acked-by: Michal Hocko <mhocko@suse.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

-- 
Michal Hocko
SUSE Labs

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web