linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: mm: make use of new memblocks_present() helper
@ 2019-03-19 18:13 Logan Gunthorpe
  2019-03-19 20:42 ` Mike Rapoport
  0 siblings, 1 reply; 5+ messages in thread
From: Logan Gunthorpe @ 2019-03-19 18:13 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: Mike Rapoport, Andrew Morton, Florian Fainelli, Rob Herring,
	Logan Gunthorpe, Russell King, Kees Cook, Philip Derrin,
	Steven Rostedt (VMware),
	Nicolas Pitre

Cleanup the arm_memory_present() function seeing it's very
similar to other arches.

The new memblocks_present() helper checks for node ids which the
arm version did not. However, this is equivalent seeing
HAVE_MEMBLOCK_NODE_MAP should be false in this arch and therefore
memblock_get_region_node() should return 0.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Kees Cook <keescook@chromium.org>
Cc: Philip Derrin <philip@cog.systems>
Cc: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
---
 arch/arm/mm/init.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

This is just a resend.

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.20.1

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

* Re: [PATCH] ARM: mm: make use of new memblocks_present() helper
  2019-03-19 18:13 [PATCH] ARM: mm: make use of new memblocks_present() helper Logan Gunthorpe
@ 2019-03-19 20:42 ` Mike Rapoport
  2019-03-19 20:50   ` Logan Gunthorpe
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Rapoport @ 2019-03-19 20:42 UTC (permalink / raw)
  To: Logan Gunthorpe
  Cc: linux-arm-kernel, linux-kernel, Andrew Morton, Florian Fainelli,
	Rob Herring, Russell King, Kees Cook, Philip Derrin,
	Steven Rostedt (VMware),
	Nicolas Pitre

On Tue, Mar 19, 2019 at 12:13:57PM -0600, Logan Gunthorpe wrote:
> Cleanup the arm_memory_present() function seeing it's very
> similar to other arches.
> 
> The new memblocks_present() helper checks for node ids which the
> arm version did not. However, this is equivalent seeing
> HAVE_MEMBLOCK_NODE_MAP should be false in this arch and therefore
> memblock_get_region_node() should return 0.
> 
> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
> Cc: Russell King <linux@armlinux.org.uk>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Philip Derrin <philip@cog.systems>
> Cc: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> Cc: Nicolas Pitre <nicolas.pitre@linaro.org>

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

Strangely, I've got a feeling I've already reviewed such patch from a
different person...

> ---
>  arch/arm/mm/init.c | 17 +----------------
>  1 file changed, 1 insertion(+), 16 deletions(-)
> 
> This is just a resend.
> 
> 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.20.1
> 

-- 
Sincerely yours,
Mike.


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

* Re: [PATCH] ARM: mm: make use of new memblocks_present() helper
  2019-03-19 20:42 ` Mike Rapoport
@ 2019-03-19 20:50   ` Logan Gunthorpe
  2019-03-19 21:05     ` Mike Rapoport
  0 siblings, 1 reply; 5+ messages in thread
From: Logan Gunthorpe @ 2019-03-19 20:50 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: linux-arm-kernel, linux-kernel, Andrew Morton, Florian Fainelli,
	Rob Herring, Russell King, Kees Cook, Philip Derrin,
	Steven Rostedt (VMware),
	Nicolas Pitre



On 2019-03-19 2:42 p.m., Mike Rapoport wrote:
> On Tue, Mar 19, 2019 at 12:13:57PM -0600, Logan Gunthorpe wrote:
>> Cleanup the arm_memory_present() function seeing it's very
>> similar to other arches.
>>
>> The new memblocks_present() helper checks for node ids which the
>> arm version did not. However, this is equivalent seeing
>> HAVE_MEMBLOCK_NODE_MAP should be false in this arch and therefore
>> memblock_get_region_node() should return 0.
>>
>> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
>> Cc: Russell King <linux@armlinux.org.uk>
>> Cc: Kees Cook <keescook@chromium.org>
>> Cc: Philip Derrin <philip@cog.systems>
>> Cc: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
>> Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
> 
> Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
> 
> Strangely, I've got a feeling I've already reviewed such patch from a
> different person...

You're probably referring to [1] which was for arm64 and was redundant
as my patch for that architecture was already picked up by Catalin.

I was the person who originally introduced memblocks_present() and I'm
still hoping to get the cleanup patches for the arm and sh arches to be
picked up.

Thanks,

Logan

[1]
https://lore.kernel.org/lkml/20190210093738.30923-1-peng.fan@nxp.com/T/#u

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

* Re: [PATCH] ARM: mm: make use of new memblocks_present() helper
  2019-03-19 20:50   ` Logan Gunthorpe
@ 2019-03-19 21:05     ` Mike Rapoport
  2019-03-19 21:12       ` Logan Gunthorpe
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Rapoport @ 2019-03-19 21:05 UTC (permalink / raw)
  To: Logan Gunthorpe
  Cc: linux-arm-kernel, linux-kernel, Andrew Morton, Florian Fainelli,
	Rob Herring, Russell King, Kees Cook, Philip Derrin,
	Steven Rostedt (VMware),
	Nicolas Pitre

On Tue, Mar 19, 2019 at 02:50:25PM -0600, Logan Gunthorpe wrote:
> 
> 
> On 2019-03-19 2:42 p.m., Mike Rapoport wrote:
> > On Tue, Mar 19, 2019 at 12:13:57PM -0600, Logan Gunthorpe wrote:
> >> Cleanup the arm_memory_present() function seeing it's very
> >> similar to other arches.
> >>
> >> The new memblocks_present() helper checks for node ids which the
> >> arm version did not. However, this is equivalent seeing
> >> HAVE_MEMBLOCK_NODE_MAP should be false in this arch and therefore
> >> memblock_get_region_node() should return 0.
> >>
> >> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
> >> Cc: Russell King <linux@armlinux.org.uk>
> >> Cc: Kees Cook <keescook@chromium.org>
> >> Cc: Philip Derrin <philip@cog.systems>
> >> Cc: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> >> Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
> > 
> > Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
> > 
> > Strangely, I've got a feeling I've already reviewed such patch from a
> > different person...
> 
> You're probably referring to [1] which was for arm64 and was redundant
> as my patch for that architecture was already picked up by Catalin.

I've found the patch [1] I mentioned, and it was for ARM.

> I was the person who originally introduced memblocks_present() and I'm
> still hoping to get the cleanup patches for the arm and sh arches to be
> picked up.

AFAIK, For ARM you'd need to put it into Russel's patch tracking system [2].

> Thanks,
> 
> Logan
> 
> [1]
> https://lore.kernel.org/lkml/20190210093738.30923-1-peng.fan@nxp.com/T/#u
> 

[1] https://lore.kernel.org/lkml/20190211131602.3294-1-peng.fan@nxp.com
[2] https://www.arm.linux.org.uk/developer/patches/

-- 
Sincerely yours,
Mike.


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

* Re: [PATCH] ARM: mm: make use of new memblocks_present() helper
  2019-03-19 21:05     ` Mike Rapoport
@ 2019-03-19 21:12       ` Logan Gunthorpe
  0 siblings, 0 replies; 5+ messages in thread
From: Logan Gunthorpe @ 2019-03-19 21:12 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: linux-arm-kernel, linux-kernel, Andrew Morton, Florian Fainelli,
	Rob Herring, Russell King, Kees Cook, Philip Derrin,
	Steven Rostedt (VMware),
	Nicolas Pitre



On 2019-03-19 3:05 p.m., Mike Rapoport wrote:
>> You're probably referring to [1] which was for arm64 and was redundant
>> as my patch for that architecture was already picked up by Catalin.
> 
> I've found the patch [1] I mentioned, and it was for ARM.

Ah, well, I wish knew I knew ahead of time that someone was doing my
work for me... My initial submission seemed to have been missed[1].

> AFAIK, For ARM you'd need to put it into Russel's patch tracking system [2].

Ah, I did not know this.

Logan

[1] https://lore.kernel.org/lkml/20190109202100.6968-2-logang@deltatee.com/

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

end of thread, other threads:[~2019-03-19 21:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-19 18:13 [PATCH] ARM: mm: make use of new memblocks_present() helper Logan Gunthorpe
2019-03-19 20:42 ` Mike Rapoport
2019-03-19 20:50   ` Logan Gunthorpe
2019-03-19 21:05     ` Mike Rapoport
2019-03-19 21:12       ` Logan Gunthorpe

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).