* [PATCH] arm: Update memblock limit after mapping lowmem
@ 2015-06-04 19:15 Laura Abbott
2015-06-11 13:07 ` Mark Rutland
0 siblings, 1 reply; 4+ messages in thread
From: Laura Abbott @ 2015-06-04 19:15 UTC (permalink / raw)
To: Russell King, Mark Rutland, Arnd Bergmann, Nicolas Pitre, Stefan Agner
Cc: Laura Abbott, Catalin Marinas, Will Deacon, linux-arm-kernel,
linux-kernel, Hans de Goede
The memblock limit is currently used in find_limits
to find the bounds for ZONE_NORMAL. The memblock
limit may need to be rounded down a PMD size to ensure
allocations are fully mapped though. This has the side
effect of reducing the amount of memory in ZONE_NORMAL.
Once all lowmem is mapped, it's safe to change the memblock
limit back to include the unaligned section. Adjust the
memblock limit after lowmem mapping is complete.
Before:
# cat /proc/zoneinfo | grep managed
managed 62907
managed 424
After:
# cat /proc/zoneinfo | grep managed
managed 63331
Signed-off-by: Laura Abbott <labbott@fedoraproject.org>
---
This is a replacement for
'arm: Don't use memblock limit for the lowmem bound' which
doesn't actually work on NOMMU systems.
---
arch/arm/mm/mmu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 7186382..904d153 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -1519,6 +1519,7 @@ void __init paging_init(const struct machine_desc *mdesc)
build_mem_type_table();
prepare_page_table();
map_lowmem();
+ memblock_set_current_limit(arm_lowmem_limit);
dma_contiguous_remap();
devicemaps_init(mdesc);
kmap_init();
--
2.4.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] arm: Update memblock limit after mapping lowmem
2015-06-04 19:15 [PATCH] arm: Update memblock limit after mapping lowmem Laura Abbott
@ 2015-06-11 13:07 ` Mark Rutland
2015-06-25 0:07 ` Laura Abbott
0 siblings, 1 reply; 4+ messages in thread
From: Mark Rutland @ 2015-06-11 13:07 UTC (permalink / raw)
To: Laura Abbott
Cc: Russell King, Arnd Bergmann, Nicolas Pitre, Stefan Agner,
Catalin Marinas, Will Deacon, linux-arm-kernel, linux-kernel,
Hans de Goede
On Thu, Jun 04, 2015 at 08:15:49PM +0100, Laura Abbott wrote:
>
> The memblock limit is currently used in find_limits
> to find the bounds for ZONE_NORMAL. The memblock
> limit may need to be rounded down a PMD size to ensure
> allocations are fully mapped though. This has the side
> effect of reducing the amount of memory in ZONE_NORMAL.
> Once all lowmem is mapped, it's safe to change the memblock
> limit back to include the unaligned section. Adjust the
> memblock limit after lowmem mapping is complete.
>
> Before:
> # cat /proc/zoneinfo | grep managed
> managed 62907
> managed 424
>
> After:
> # cat /proc/zoneinfo | grep managed
> managed 63331
>
> Signed-off-by: Laura Abbott <labbott@fedoraproject.org>
> ---
> This is a replacement for
> 'arm: Don't use memblock limit for the lowmem bound' which
> doesn't actually work on NOMMU systems.
Works for me on TC2, atop v4.1-rc7. Before this patch, with a few byes
carved out of the memory node I would see:
Memory: 1030380K/1046528K available (4832K kernel code, 154K rwdata, 1376K rodata, 260K init, 147K bss, 16148K reserved, 0K cma-reserved)
$ cat /proc/zoneinfo | grep managed
managed 257660
With the patch I see:
Memory: 1032424K/1048572K available (4832K kernel code, 154K rwdata, 1376K rodata, 260K init, 147K bss, 16148K reserved, 0K cma-reserved)
$ cat /proc/zoneinfo | grep managed
managed 258171
The patch itself looks good to me.
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Thanks,
Mark.
> ---
> arch/arm/mm/mmu.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
> index 7186382..904d153 100644
> --- a/arch/arm/mm/mmu.c
> +++ b/arch/arm/mm/mmu.c
> @@ -1519,6 +1519,7 @@ void __init paging_init(const struct machine_desc *mdesc)
> build_mem_type_table();
> prepare_page_table();
> map_lowmem();
> + memblock_set_current_limit(arm_lowmem_limit);
> dma_contiguous_remap();
> devicemaps_init(mdesc);
> kmap_init();
> --
> 2.4.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] arm: Update memblock limit after mapping lowmem
2015-06-11 13:07 ` Mark Rutland
@ 2015-06-25 0:07 ` Laura Abbott
2015-07-01 8:09 ` Javier Martinez Canillas
0 siblings, 1 reply; 4+ messages in thread
From: Laura Abbott @ 2015-06-25 0:07 UTC (permalink / raw)
To: Mark Rutland, Laura Abbott
Cc: Russell King, Arnd Bergmann, Nicolas Pitre, Stefan Agner,
Catalin Marinas, Will Deacon, linux-arm-kernel, linux-kernel,
Hans de Goede
On 06/11/2015 06:07 AM, Mark Rutland wrote:
> On Thu, Jun 04, 2015 at 08:15:49PM +0100, Laura Abbott wrote:
>>
>> The memblock limit is currently used in find_limits
>> to find the bounds for ZONE_NORMAL. The memblock
>> limit may need to be rounded down a PMD size to ensure
>> allocations are fully mapped though. This has the side
>> effect of reducing the amount of memory in ZONE_NORMAL.
>> Once all lowmem is mapped, it's safe to change the memblock
>> limit back to include the unaligned section. Adjust the
>> memblock limit after lowmem mapping is complete.
>>
>> Before:
>> # cat /proc/zoneinfo | grep managed
>> managed 62907
>> managed 424
>>
>> After:
>> # cat /proc/zoneinfo | grep managed
>> managed 63331
>>
>> Signed-off-by: Laura Abbott <labbott@fedoraproject.org>
>> ---
>> This is a replacement for
>> 'arm: Don't use memblock limit for the lowmem bound' which
>> doesn't actually work on NOMMU systems.
>
> Works for me on TC2, atop v4.1-rc7. Before this patch, with a few byes
> carved out of the memory node I would see:
>
> Memory: 1030380K/1046528K available (4832K kernel code, 154K rwdata, 1376K rodata, 260K init, 147K bss, 16148K reserved, 0K cma-reserved)
>
> $ cat /proc/zoneinfo | grep managed
> managed 257660
>
> With the patch I see:
>
> Memory: 1032424K/1048572K available (4832K kernel code, 154K rwdata, 1376K rodata, 260K init, 147K bss, 16148K reserved, 0K cma-reserved)
>
> $ cat /proc/zoneinfo | grep managed
> managed 258171
>
> The patch itself looks good to me.
>
> Reviewed-by: Mark Rutland <mark.rutland@arm.com>
> Tested-by: Mark Rutland <mark.rutland@arm.com>
>
> Thanks,
> Mark.
>
FYI, I put this in the patch tracker. I was on vacation when the Reviewed-by/Tested-by
came in so I'm only getting to it now.
Thanks,
Laura
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] arm: Update memblock limit after mapping lowmem
2015-06-25 0:07 ` Laura Abbott
@ 2015-07-01 8:09 ` Javier Martinez Canillas
0 siblings, 0 replies; 4+ messages in thread
From: Javier Martinez Canillas @ 2015-07-01 8:09 UTC (permalink / raw)
To: Laura Abbott
Cc: Mark Rutland, Laura Abbott, Russell King, Arnd Bergmann,
Nicolas Pitre, Catalin Marinas, Will Deacon, linux-kernel,
Stefan Agner, Hans de Goede, linux-arm-kernel
Hello Laura,
On Thu, Jun 25, 2015 at 2:07 AM, Laura Abbott <labbott@redhat.com> wrote:
> On 06/11/2015 06:07 AM, Mark Rutland wrote:
>>
>> On Thu, Jun 04, 2015 at 08:15:49PM +0100, Laura Abbott wrote:
>>>
>>>
>>> The memblock limit is currently used in find_limits
>>> to find the bounds for ZONE_NORMAL. The memblock
>>> limit may need to be rounded down a PMD size to ensure
>>> allocations are fully mapped though. This has the side
>>> effect of reducing the amount of memory in ZONE_NORMAL.
>>> Once all lowmem is mapped, it's safe to change the memblock
>>> limit back to include the unaligned section. Adjust the
>>> memblock limit after lowmem mapping is complete.
>>>
>>> Before:
>>> # cat /proc/zoneinfo | grep managed
>>> managed 62907
>>> managed 424
>>>
>>> After:
>>> # cat /proc/zoneinfo | grep managed
>>> managed 63331
>>>
>>> Signed-off-by: Laura Abbott <labbott@fedoraproject.org>
>>> ---
>>> This is a replacement for
>>> 'arm: Don't use memblock limit for the lowmem bound' which
>>> doesn't actually work on NOMMU systems.
>>
>>
>> Works for me on TC2, atop v4.1-rc7. Before this patch, with a few byes
>> carved out of the memory node I would see:
>>
>> Memory: 1030380K/1046528K available (4832K kernel code, 154K rwdata, 1376K
>> rodata, 260K init, 147K bss, 16148K reserved, 0K cma-reserved)
>>
>> $ cat /proc/zoneinfo | grep managed
>> managed 257660
>>
>> With the patch I see:
>>
>> Memory: 1032424K/1048572K available (4832K kernel code, 154K rwdata, 1376K
>> rodata, 260K init, 147K bss, 16148K reserved, 0K cma-reserved)
>>
>> $ cat /proc/zoneinfo | grep managed
>> managed 258171
>>
>> The patch itself looks good to me.
>>
>> Reviewed-by: Mark Rutland <mark.rutland@arm.com>
>> Tested-by: Mark Rutland <mark.rutland@arm.com>
>>
>> Thanks,
>> Mark.
>>
>
> FYI, I put this in the patch tracker. I was on vacation when the
> Reviewed-by/Tested-by
> came in so I'm only getting to it now.
>
Maybe is a little late but just for reference, this patch fixes a boot
hang that was reported [0] for the Exynos Chromebooks that was in
v4.1.
So on an Exynos5420 Peach Pit Chromebook:
Tested-by: Javier Martinez Canillas <javier@dowhile0.org>
The patch also looks good to me:
Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org>
> Thanks,
> Laura
>
Best regards,
Javier
[0]: http://archive.arm.linux.org.uk/lurker/message/20150630.100102.22c9c1d9.en.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-07-01 8:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-04 19:15 [PATCH] arm: Update memblock limit after mapping lowmem Laura Abbott
2015-06-11 13:07 ` Mark Rutland
2015-06-25 0:07 ` Laura Abbott
2015-07-01 8:09 ` Javier Martinez Canillas
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).