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


Groups > linux.kernel > #1371312 > unrolled thread

[PATCH 2/2] arm64: mm: make pfn always valid with flat memory

Started byChen Feng <puck.chen@hisilicon.com>
First post2016-04-05 10:30 +0200
Last post2016-04-12 17:10 +0200
Articles 4 — 3 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] arm64: mm: make pfn always valid with flat memory Chen Feng <puck.chen@hisilicon.com> - 2016-04-05 10:30 +0200
    Re: [PATCH 2/2] arm64: mm: make pfn always valid with flat memory Chen Feng <puck.chen@hisilicon.com> - 2016-04-07 09:50 +0200
    Re: [PATCH 2/2] arm64: mm: make pfn always valid with flat memory Xishi Qiu <qiuxishi@huawei.com> - 2016-04-11 13:20 +0200
      Re: [PATCH 2/2] arm64: mm: make pfn always valid with flat memory Catalin Marinas <catalin.marinas@arm.com> - 2016-04-12 17:10 +0200

#1371312 — [PATCH 2/2] arm64: mm: make pfn always valid with flat memory

FromChen Feng <puck.chen@hisilicon.com>
Date2016-04-05 10:30 +0200
Subject[PATCH 2/2] arm64: mm: make pfn always valid with flat memory
Message-ID<rkux3-hF-1@gated-at.bofh.it>
Make the pfn always valid when using flat memory.
If the reserved memory is not align to memblock-size,
there will be holes in zone.

This patch makes the memory in buddy always in the
array of mem-map.

Signed-off-by: Chen Feng <puck.chen@hisilicon.com>
Signed-off-by: Fu Jun <oliver.fu@hisilicon.com>
---
 arch/arm64/mm/init.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index ea989d8..0e1d5b7 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -306,7 +306,8 @@ static void __init free_unused_memmap(void)
 	struct memblock_region *reg;
 
 	for_each_memblock(memory, reg) {
-		start = __phys_to_pfn(reg->base);
+		start = round_down(__phys_to_pfn(reg->base),
+				   MAX_ORDER_NR_PAGES);
 
 #ifdef CONFIG_SPARSEMEM
 		/*
@@ -327,8 +328,8 @@ static void __init free_unused_memmap(void)
 		 * memmap entries are valid from the bank end aligned to
 		 * MAX_ORDER_NR_PAGES.
 		 */
-		prev_end = ALIGN(__phys_to_pfn(reg->base + reg->size),
-				 MAX_ORDER_NR_PAGES);
+		prev_end = round_up(__phys_to_pfn(reg->base + reg->size),
+				    MAX_ORDER_NR_PAGES);
 	}
 
 #ifdef CONFIG_SPARSEMEM
-- 
1.9.1

[toc] | [next] | [standalone]


#1373125

FromChen Feng <puck.chen@hisilicon.com>
Date2016-04-07 09:50 +0200
Message-ID<rlcRt-tI-27@gated-at.bofh.it>
In reply to#1371312
add Mel Gorman

On 2016/4/5 16:22, Chen Feng wrote:
> Make the pfn always valid when using flat memory.
> If the reserved memory is not align to memblock-size,
> there will be holes in zone.
> 
> This patch makes the memory in buddy always in the
> array of mem-map.
> 
> Signed-off-by: Chen Feng <puck.chen@hisilicon.com>
> Signed-off-by: Fu Jun <oliver.fu@hisilicon.com>
> ---
>  arch/arm64/mm/init.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
> index ea989d8..0e1d5b7 100644
> --- a/arch/arm64/mm/init.c
> +++ b/arch/arm64/mm/init.c
> @@ -306,7 +306,8 @@ static void __init free_unused_memmap(void)
>  	struct memblock_region *reg;
>  
>  	for_each_memblock(memory, reg) {
> -		start = __phys_to_pfn(reg->base);
> +		start = round_down(__phys_to_pfn(reg->base),
> +				   MAX_ORDER_NR_PAGES);
>  
>  #ifdef CONFIG_SPARSEMEM
>  		/*
> @@ -327,8 +328,8 @@ static void __init free_unused_memmap(void)
>  		 * memmap entries are valid from the bank end aligned to
>  		 * MAX_ORDER_NR_PAGES.
>  		 */
> -		prev_end = ALIGN(__phys_to_pfn(reg->base + reg->size),
> -				 MAX_ORDER_NR_PAGES);
> +		prev_end = round_up(__phys_to_pfn(reg->base + reg->size),
> +				    MAX_ORDER_NR_PAGES);
>  	}
>  
>  #ifdef CONFIG_SPARSEMEM
> 

[toc] | [prev] | [next] | [standalone]


#1375708

FromXishi Qiu <qiuxishi@huawei.com>
Date2016-04-11 13:20 +0200
Message-ID<rmI2S-4Vk-17@gated-at.bofh.it>
In reply to#1371312
On 2016/4/5 16:22, Chen Feng wrote:

> Make the pfn always valid when using flat memory.
> If the reserved memory is not align to memblock-size,
> there will be holes in zone.
> 
> This patch makes the memory in buddy always in the
> array of mem-map.
> 
> Signed-off-by: Chen Feng <puck.chen@hisilicon.com>
> Signed-off-by: Fu Jun <oliver.fu@hisilicon.com>
> ---
>  arch/arm64/mm/init.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
> index ea989d8..0e1d5b7 100644
> --- a/arch/arm64/mm/init.c
> +++ b/arch/arm64/mm/init.c
> @@ -306,7 +306,8 @@ static void __init free_unused_memmap(void)

How about let free_unused_memmap() support for CONFIG_SPARSEMEM_VMEMMAP?

Thanks,
Xishi Qiu

>  	struct memblock_region *reg;
>  
>  	for_each_memblock(memory, reg) {
> -		start = __phys_to_pfn(reg->base);
> +		start = round_down(__phys_to_pfn(reg->base),
> +				   MAX_ORDER_NR_PAGES);
>  
>  #ifdef CONFIG_SPARSEMEM
>  		/*
> @@ -327,8 +328,8 @@ static void __init free_unused_memmap(void)
>  		 * memmap entries are valid from the bank end aligned to
>  		 * MAX_ORDER_NR_PAGES.
>  		 */
> -		prev_end = ALIGN(__phys_to_pfn(reg->base + reg->size),
> -				 MAX_ORDER_NR_PAGES);
> +		prev_end = round_up(__phys_to_pfn(reg->base + reg->size),
> +				    MAX_ORDER_NR_PAGES);
>  	}
>  
>  #ifdef CONFIG_SPARSEMEM

[toc] | [prev] | [next] | [standalone]


#1376880

FromCatalin Marinas <catalin.marinas@arm.com>
Date2016-04-12 17:10 +0200
Message-ID<rn870-W0-7@gated-at.bofh.it>
In reply to#1375708
On Mon, Apr 11, 2016 at 07:08:38PM +0800, Xishi Qiu wrote:
> On 2016/4/5 16:22, Chen Feng wrote:
> 
> > Make the pfn always valid when using flat memory.
> > If the reserved memory is not align to memblock-size,
> > there will be holes in zone.
> > 
> > This patch makes the memory in buddy always in the
> > array of mem-map.
> > 
> > Signed-off-by: Chen Feng <puck.chen@hisilicon.com>
> > Signed-off-by: Fu Jun <oliver.fu@hisilicon.com>
> > ---
> >  arch/arm64/mm/init.c | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
> > index ea989d8..0e1d5b7 100644
> > --- a/arch/arm64/mm/init.c
> > +++ b/arch/arm64/mm/init.c
> > @@ -306,7 +306,8 @@ static void __init free_unused_memmap(void)
> 
> How about let free_unused_memmap() support for CONFIG_SPARSEMEM_VMEMMAP?

We would need extra care to check that the memmap was actually allocated
in the first place.

-- 
Catalin

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web