Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] arm: use memblocks_present
@ 2019-02-11 13:04 Peng Fan
  2019-02-11 13:30 ` Mike Rapoport
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Peng Fan @ 2019-02-11 13:04 UTC (permalink / raw)
  To: linux, arnd, rppt, robh, f.fainelli, akpm, mhocko, rostedt,
	nicolas.pitre
  Cc: van.freenix, Peng Fan, linux-kernel, linux-arm-kernel

arm_memory_present is doing same thing as memblocks_present, so
let's use common code memblocks_present instead of platform
specific arm_memory_present.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/mm/init.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 478ea8b7db87..6c50dd407ba8 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -182,21 +182,6 @@ int pfn_valid(unsigned long pfn)
 EXPORT_SYMBOL(pfn_valid);
 #endif
 
-#ifndef CONFIG_SPARSEMEM
-static void __init arm_memory_present(void)
-{
-}
-#else
-static void __init arm_memory_present(void)
-{
-	struct memblock_region *reg;
-
-	for_each_memblock(memory, reg)
-		memory_present(0, memblock_region_memory_base_pfn(reg),
-			       memblock_region_memory_end_pfn(reg));
-}
-#endif
-
 static bool arm_memblock_steal_permitted = true;
 
 phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align)
@@ -292,7 +277,7 @@ void __init bootmem_init(void)
 	 * Sparsemem tries to allocate bootmem in memory_present(),
 	 * so must be done after the fixed reservations
 	 */
-	arm_memory_present();
+	memblocks_present();
 
 	/*
 	 * sparse_init() needs the bootmem allocator up and running.
-- 
2.16.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] arm: use memblocks_present
  2019-02-11 13:04 [PATCH] arm: use memblocks_present Peng Fan
@ 2019-02-11 13:30 ` Mike Rapoport
  2019-02-11 14:00 ` Michal Hocko
  2019-02-12 17:27 ` Russell King - ARM Linux admin
  2 siblings, 0 replies; 7+ messages in thread
From: Mike Rapoport @ 2019-02-11 13:30 UTC (permalink / raw)
  To: Peng Fan
  Cc: nicolas.pitre, robh, f.fainelli, arnd, mhocko, linux, rostedt,
	linux-kernel, rppt, van.freenix, akpm, linux-arm-kernel

On Mon, Feb 11, 2019 at 01:04:59PM +0000, Peng Fan wrote:
> arm_memory_present is doing same thing as memblocks_present, so
> let's use common code memblocks_present instead of platform
> specific arm_memory_present.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>

Acked-by: Mike Rapoport <rppt@linux.ibm.com>

> ---
>  arch/arm/mm/init.c | 17 +----------------
>  1 file changed, 1 insertion(+), 16 deletions(-)
> 
> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
> index 478ea8b7db87..6c50dd407ba8 100644
> --- a/arch/arm/mm/init.c
> +++ b/arch/arm/mm/init.c
> @@ -182,21 +182,6 @@ int pfn_valid(unsigned long pfn)
>  EXPORT_SYMBOL(pfn_valid);
>  #endif
>  
> -#ifndef CONFIG_SPARSEMEM
> -static void __init arm_memory_present(void)
> -{
> -}
> -#else
> -static void __init arm_memory_present(void)
> -{
> -	struct memblock_region *reg;
> -
> -	for_each_memblock(memory, reg)
> -		memory_present(0, memblock_region_memory_base_pfn(reg),
> -			       memblock_region_memory_end_pfn(reg));
> -}
> -#endif
> -
>  static bool arm_memblock_steal_permitted = true;
>  
>  phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align)
> @@ -292,7 +277,7 @@ void __init bootmem_init(void)
>  	 * Sparsemem tries to allocate bootmem in memory_present(),
>  	 * so must be done after the fixed reservations
>  	 */
> -	arm_memory_present();
> +	memblocks_present();
>  
>  	/*
>  	 * sparse_init() needs the bootmem allocator up and running.
> -- 
> 2.16.4
> 

-- 
Sincerely yours,
Mike.


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] arm: use memblocks_present
  2019-02-11 13:04 [PATCH] arm: use memblocks_present Peng Fan
  2019-02-11 13:30 ` Mike Rapoport
@ 2019-02-11 14:00 ` Michal Hocko
  2019-02-12 17:27 ` Russell King - ARM Linux admin
  2 siblings, 0 replies; 7+ messages in thread
From: Michal Hocko @ 2019-02-11 14:00 UTC (permalink / raw)
  To: Peng Fan
  Cc: nicolas.pitre, robh, f.fainelli, arnd, linux, rostedt,
	linux-kernel, rppt, van.freenix, akpm, linux-arm-kernel

On Mon 11-02-19 13:04:59, Peng Fan wrote:
> arm_memory_present is doing same thing as memblocks_present, so
> let's use common code memblocks_present instead of platform
> specific arm_memory_present.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
>  arch/arm/mm/init.c | 17 +----------------
>  1 file changed, 1 insertion(+), 16 deletions(-)
> 
> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
> index 478ea8b7db87..6c50dd407ba8 100644
> --- a/arch/arm/mm/init.c
> +++ b/arch/arm/mm/init.c
> @@ -182,21 +182,6 @@ int pfn_valid(unsigned long pfn)
>  EXPORT_SYMBOL(pfn_valid);
>  #endif
>  
> -#ifndef CONFIG_SPARSEMEM
> -static void __init arm_memory_present(void)
> -{
> -}
> -#else
> -static void __init arm_memory_present(void)
> -{
> -	struct memblock_region *reg;
> -
> -	for_each_memblock(memory, reg)
> -		memory_present(0, memblock_region_memory_base_pfn(reg),
> -			       memblock_region_memory_end_pfn(reg));
> -}
> -#endif
> -
>  static bool arm_memblock_steal_permitted = true;
>  
>  phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align)
> @@ -292,7 +277,7 @@ void __init bootmem_init(void)
>  	 * Sparsemem tries to allocate bootmem in memory_present(),
>  	 * so must be done after the fixed reservations
>  	 */
> -	arm_memory_present();
> +	memblocks_present();
>  
>  	/*
>  	 * sparse_init() needs the bootmem allocator up and running.
> -- 
> 2.16.4

-- 
Michal Hocko
SUSE Labs

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] arm: use memblocks_present
  2019-02-11 13:04 [PATCH] arm: use memblocks_present Peng Fan
  2019-02-11 13:30 ` Mike Rapoport
  2019-02-11 14:00 ` Michal Hocko
@ 2019-02-12 17:27 ` Russell King - ARM Linux admin
  2019-03-19 12:06   ` Peng Fan
  2 siblings, 1 reply; 7+ messages in thread
From: Russell King - ARM Linux admin @ 2019-02-12 17:27 UTC (permalink / raw)
  To: Peng Fan
  Cc: nicolas.pitre, robh, mhocko, arnd, linux-kernel, rostedt, rppt,
	van.freenix, f.fainelli, akpm, linux-arm-kernel

On Mon, Feb 11, 2019 at 01:04:59PM +0000, Peng Fan wrote:
> arm_memory_present is doing same thing as memblocks_present, so
> let's use common code memblocks_present instead of platform
> specific arm_memory_present.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>

Looks good, please put it in the patch system, thanks.  Details in
my signature.

> ---
>  arch/arm/mm/init.c | 17 +----------------
>  1 file changed, 1 insertion(+), 16 deletions(-)
> 
> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
> index 478ea8b7db87..6c50dd407ba8 100644
> --- a/arch/arm/mm/init.c
> +++ b/arch/arm/mm/init.c
> @@ -182,21 +182,6 @@ int pfn_valid(unsigned long pfn)
>  EXPORT_SYMBOL(pfn_valid);
>  #endif
>  
> -#ifndef CONFIG_SPARSEMEM
> -static void __init arm_memory_present(void)
> -{
> -}
> -#else
> -static void __init arm_memory_present(void)
> -{
> -	struct memblock_region *reg;
> -
> -	for_each_memblock(memory, reg)
> -		memory_present(0, memblock_region_memory_base_pfn(reg),
> -			       memblock_region_memory_end_pfn(reg));
> -}
> -#endif
> -
>  static bool arm_memblock_steal_permitted = true;
>  
>  phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align)
> @@ -292,7 +277,7 @@ void __init bootmem_init(void)
>  	 * Sparsemem tries to allocate bootmem in memory_present(),
>  	 * so must be done after the fixed reservations
>  	 */
> -	arm_memory_present();
> +	memblocks_present();
>  
>  	/*
>  	 * sparse_init() needs the bootmem allocator up and running.
> -- 
> 2.16.4
> 
> 

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] arm: use memblocks_present
  2019-02-12 17:27 ` Russell King - ARM Linux admin
@ 2019-03-19 12:06   ` Peng Fan
  2019-03-19 13:14     ` Fabio Estevam
  0 siblings, 1 reply; 7+ messages in thread
From: Peng Fan @ 2019-03-19 12:06 UTC (permalink / raw)
  To: Russell King - ARM Linux admin
  Cc: nicolas.pitre, robh, mhocko, arnd, linux-kernel, rostedt, rppt,
	van.freenix, f.fainelli, akpm, linux-arm-kernel

Hi Russell,

> -----Original Message-----
> From: Russell King - ARM Linux admin [mailto:linux@armlinux.org.uk]
> Sent: 2019Äê2ÔÂ13ÈÕ 1:27
> To: Peng Fan <peng.fan@nxp.com>
> Cc: arnd@arndb.de; rppt@linux.vnet.ibm.com; robh@kernel.org;
> f.fainelli@gmail.com; akpm@linux-foundation.org; mhocko@suse.com;
> rostedt@goodmis.org; nicolas.pitre@linaro.org;
> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org;
> van.freenix@gmail.com
> Subject: Re: [PATCH] arm: use memblocks_present
> 
> On Mon, Feb 11, 2019 at 01:04:59PM +0000, Peng Fan wrote:
> > arm_memory_present is doing same thing as memblocks_present, so let's
> > use common code memblocks_present instead of platform specific
> > arm_memory_present.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> 
> Looks good, please put it in the patch system, thanks.  Details in my
> signature.

Would you apply this patch? I do not find this patch in your tree.

Thanks,
Peng.

> 
> > ---
> >  arch/arm/mm/init.c | 17 +----------------
> >  1 file changed, 1 insertion(+), 16 deletions(-)
> >
> > diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index
> > 478ea8b7db87..6c50dd407ba8 100644
> > --- a/arch/arm/mm/init.c
> > +++ b/arch/arm/mm/init.c
> > @@ -182,21 +182,6 @@ int pfn_valid(unsigned long pfn)
> > EXPORT_SYMBOL(pfn_valid);  #endif
> >
> > -#ifndef CONFIG_SPARSEMEM
> > -static void __init arm_memory_present(void) -{ -} -#else -static void
> > __init arm_memory_present(void) -{
> > -	struct memblock_region *reg;
> > -
> > -	for_each_memblock(memory, reg)
> > -		memory_present(0, memblock_region_memory_base_pfn(reg),
> > -			       memblock_region_memory_end_pfn(reg));
> > -}
> > -#endif
> > -
> >  static bool arm_memblock_steal_permitted = true;
> >
> >  phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t
> > align) @@ -292,7 +277,7 @@ void __init bootmem_init(void)
> >  	 * Sparsemem tries to allocate bootmem in memory_present(),
> >  	 * so must be done after the fixed reservations
> >  	 */
> > -	arm_memory_present();
> > +	memblocks_present();
> >
> >  	/*
> >  	 * sparse_init() needs the bootmem allocator up and running.
> > --
> > 2.16.4
> >
> >
> 
> --
> RMK's Patch system:
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fww
> w.armlinux.org.uk%2Fdeveloper%2Fpatches%2F&amp;data=02%7C01%7Cpe
> ng.fan%40nxp.com%7Cb710ce9f14c942463c7b08d6910f548a%7C686ea1d3b
> c2b4c6fa92cd99c5c301635%7C0%7C0%7C636855892359986096&amp;sdat
> a=7yqUJVZrNl5lxUwn7g0CzgF9yg764AIeiVG7wIk%2Fgt0%3D&amp;reserved=
> 0
> FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps
> up According to speedtest.net: 11.9Mbps down 500kbps up
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] arm: use memblocks_present
  2019-03-19 12:06   ` Peng Fan
@ 2019-03-19 13:14     ` Fabio Estevam
  2019-03-19 13:37       ` Peng Fan
  0 siblings, 1 reply; 7+ messages in thread
From: Fabio Estevam @ 2019-03-19 13:14 UTC (permalink / raw)
  To: Peng Fan
  Cc: nicolas.pitre, robh, mhocko, arnd,
	Russell King - ARM Linux admin, rostedt, linux-kernel, rppt,
	van.freenix, f.fainelli, akpm, linux-arm-kernel

Hi Peng,

On Tue, Mar 19, 2019 at 9:31 AM Peng Fan <peng.fan@nxp.com> wrote:

> > Looks good, please put it in the patch system, thanks.  Details in my
> > signature.
>
> Would you apply this patch? I do not find this patch in your tree.

Have you put it in Russell's patch system
(https://www.armlinux.org.uk/developer/patches/) ?

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] arm: use memblocks_present
  2019-03-19 13:14     ` Fabio Estevam
@ 2019-03-19 13:37       ` Peng Fan
  0 siblings, 0 replies; 7+ messages in thread
From: Peng Fan @ 2019-03-19 13:37 UTC (permalink / raw)
  To: Fabio Estevam, Russell King - ARM Linux admin
  Cc: nicolas.pitre, robh, mhocko, arnd, linux-kernel, rostedt, rppt,
	van.freenix, f.fainelli, akpm, linux-arm-kernel



> -----Original Message-----
> From: Fabio Estevam [mailto:festevam@gmail.com]
> Sent: 2019年3月19日 21:14
> To: Peng Fan <peng.fan@nxp.com>
> Cc: Russell King - ARM Linux admin <linux@armlinux.org.uk>;
> nicolas.pitre@linaro.org; robh@kernel.org; mhocko@suse.com;
> arnd@arndb.de; linux-kernel@vger.kernel.org; rostedt@goodmis.org;
> rppt@linux.vnet.ibm.com; van.freenix@gmail.com; f.fainelli@gmail.com;
> akpm@linux-foundation.org; linux-arm-kernel@lists.infradead.org
> Subject: Re: [PATCH] arm: use memblocks_present
> 
> Hi Peng,
> 
> On Tue, Mar 19, 2019 at 9:31 AM Peng Fan <peng.fan@nxp.com> wrote:
> 
> > > Looks good, please put it in the patch system, thanks.  Details in
> > > my signature.
> >
> > Would you apply this patch? I do not find this patch in your tree.
> 
> Have you put it in Russell's patch system

Thanks for reminding me, just added
https://www.armlinux.org.uk/developer/patches/viewpatch.php?id=8850/1

Thanks,
Peng.

> (https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
> armlinux.org.uk%2Fdeveloper%2Fpatches%2F&amp;data=02%7C01%7Cpeng.
> fan%40nxp.com%7C4491585dd8f442ae0f8508d6ac6cd313%7C686ea1d3bc2
> b4c6fa92cd99c5c301635%7C0%7C0%7C636885980729920657&amp;sdata=
> SH%2FCKbq7swWUyn2DxhxkX5hpF%2FYSD8NfC9c6bc%2FM6XM%3D&amp;r
> eserved=0) ?
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-11 13:04 [PATCH] arm: use memblocks_present Peng Fan
2019-02-11 13:30 ` Mike Rapoport
2019-02-11 14:00 ` Michal Hocko
2019-02-12 17:27 ` Russell King - ARM Linux admin
2019-03-19 12:06   ` Peng Fan
2019-03-19 13:14     ` Fabio Estevam
2019-03-19 13:37       ` Peng Fan

Linux-ARM-Kernel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/0 linux-arm-kernel/git/0.git
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/1 linux-arm-kernel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-kernel linux-arm-kernel/ https://lore.kernel.org/linux-arm-kernel \
		linux-arm-kernel@lists.infradead.org infradead-linux-arm-kernel@archiver.kernel.org
	public-inbox-index linux-arm-kernel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-arm-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox