[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DM6PR04MB60598585C233303817F4793B8D660@DM6PR04MB6059.namprd04.prod.outlook.com>
Date: Wed, 13 Feb 2019 07:49:39 +0000
From: Anup Patel <Anup.Patel@....com>
To: Mike Rapoport <rppt@...ux.ibm.com>,
Christoph Hellwig <hch@...radead.org>
CC: Palmer Dabbelt <palmer@...ive.com>,
Albert Ou <aou@...s.berkeley.edu>,
Atish Patra <Atish.Patra@....com>,
Paul Walmsley <paul.walmsley@...ive.com>,
"linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v4 6/6] RISC-V: Free-up initrd in free_initrd_mem()
> -----Original Message-----
> From: Mike Rapoport [mailto:rppt@...ux.ibm.com]
> Sent: Wednesday, February 13, 2019 1:09 PM
> To: Christoph Hellwig <hch@...radead.org>
> Cc: Anup Patel <Anup.Patel@....com>; Palmer Dabbelt
> <palmer@...ive.com>; Albert Ou <aou@...s.berkeley.edu>; Atish Patra
> <Atish.Patra@....com>; Paul Walmsley <paul.walmsley@...ive.com>; linux-
> riscv@...ts.infradead.org; linux-kernel@...r.kernel.org
> Subject: Re: [PATCH v4 6/6] RISC-V: Free-up initrd in free_initrd_mem()
>
> Hi,
>
> On Tue, Feb 12, 2019 at 10:44:19PM -0800, Christoph Hellwig wrote:
> > 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.
>
> This late in the boot process there should be a call to
> free_reserved_area() to give pages to the buddy allocator.
>
> memblock_free() is has no real effect at this point, no idea why arm64 calls it.
Thanks for the info. I will update this patch to use free_reserved_area().
Regards,
Anup
Powered by blists - more mailing lists