lkml.org 
[lkml]   [2019]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v4 6/6] RISC-V: Free-up initrd in free_initrd_mem()
On Wed, Feb 13, 2019 at 06:32:24AM +0000, Anup Patel wrote:
> index 9cd583b6d1cd..c22b873de856 100644
> --- a/arch/riscv/kernel/setup.c
> +++ b/arch/riscv/kernel/setup.c
> @@ -97,8 +97,9 @@ static void __init setup_initrd(void)
> initrd_end = 0;
> }
>
> -void free_initrd_mem(unsigned long start, unsigned long end)
> +void __init free_initrd_mem(unsigned long start, unsigned long end)
> {
> + memblock_free(__pa(start), end - start);

I'm pretty sure this should be a call to free_reserved_area instead.

All regions reserved using memblock_reserved and not freed before
initializing the MM are marked reserved and don't have valid page
counts, etc.

So we need the actions in free_reserved_area to actually make the
memory useful. Now every other architecture except for arm64
seems to do fine without a memblock_free. I'm not an expert on
memblock (but I've CCed one), but I guess the reason is that once
the kernel has booted we don't really care about freeing memblock
area.

\
 
 \ /
  Last update: 2019-02-13 07:44    [W:1.216 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site