Skip to contentSkip to conversation

arm: use memblocks_present

PATCH In review Peng Fan 5 participants 7 messages Feb 11, 2019 – Mar 19, 2019 Arm (32-bit)

lore
Share & tools
lore

Peng Fan

author
#0 lore raw

PATCH 1/1 arm: use memblocks_present

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.

---
 arch/arm/mm/init.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)
arch/arm/mm/init.c +1 -16
index 478ea8b7db87..6c50dd407ba8 100644
@@ -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.
Signature · 1 line
2.16.4
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Peng Fan

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.

Quoted 42 lines
---
 arch/arm/mm/init.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)
arch/arm/mm/init.c +1 -16
index 478ea8b7db87..6c50dd407ba8 100644
@@ -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.
Signature · 1 line
2.16.4
Signature · 2 lines
Sincerely yours,
Mike.
Acked-by on v1 1/1
#2 lore raw
In reply to Peng Fan
Quoted 5 lines · Peng Fan

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.

Quoted 41 lines
---
 arch/arm/mm/init.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)
arch/arm/mm/init.c +1 -16
index 478ea8b7db87..6c50dd407ba8 100644
@@ -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.
Signature · 1 line
2.16.4
Signature · 2 lines
Michal Hocko
SUSE Labs
#3 lore raw
In reply to Peng Fan
Quoted 5 lines · Peng Fan

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.

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

Quoted 43 lines
---
 arch/arm/mm/init.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)
arch/arm/mm/init.c +1 -16
index 478ea8b7db87..6c50dd407ba8 100644
@@ -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.
Signature · 1 line
2.16.4
Signature · 3 lines
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
author
#4 lore raw

Hi Russell,

Quoted 12 lines

-----Original Message-----
From: Russell King - ARM Linux admin [mailto:[email protected]]
Sent: 2019年2月13日 1:27
To: Peng Fan <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] arm: use memblocks_present

On Mon, Feb 11, 2019 at 01:04:59PM +0000, Peng Fan wrote:

Quoted 8 lines
Quoted 5 lines

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.

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.

Quoted 50 lines
Quoted 36 lines
---
 arch/arm/mm/init.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)
arch/arm/mm/init.c index renamed from arch/arm/mm/init.c +0 -0

478ea8b7db87..6c50dd407ba8 100644

arch/arm/mm/init.c +0 -0
@@ -182,21 +182,6 @@ int pfn_valid(unsigned long pfn)

EXPORT_SYMBOL(pfn_valid); #endif

arch/arm/mm/init.c +0 -2
-#ifndef CONFIG_SPARSEMEM
-static void __init arm_memory_present(void) -{ -} -#else -static void

__init arm_memory_present(void) -{

arch/arm/mm/init.c +0 -8
-	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)

arch/arm/mm/init.c +1 -2
 	 * 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.
--
Quoted 3 lines

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

author
#6 lore raw
Quoted 15 lines

-----Original Message-----
From: Fabio Estevam [mailto:[email protected]]
Sent: 2019年3月19日 21:14
To: Peng Fan <[email protected]>
Cc: Russell King - ARM Linux admin <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] arm: use memblocks_present

Hi Peng,

Quoted 8 lines
Quoted 4 lines · Peng Fan
Quoted 2 lines

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.

Quoted 6 lines

(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) ?