From: Mike Rapoport <rppt@linux.ibm.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Anup Patel <Anup.Patel@wdc.com>,
Palmer Dabbelt <palmer@sifive.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Atish Patra <Atish.Patra@wdc.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
"linux-riscv@lists.infradead.org"
<linux-riscv@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 6/6] RISC-V: Free-up initrd in free_initrd_mem()
Date: Wed, 13 Feb 2019 09:38:36 +0200 [thread overview]
Message-ID: <20190213073835.GA18267@rapoport-lnx> (raw)
In-Reply-To: <20190213064419.GA27012@infradead.org>
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.
--
Sincerely yours,
Mike.
next prev parent reply other threads:[~2019-02-13 7:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-13 6:31 [PATCH v4 0/6] Fixmap support and MM cleanups Anup Patel
2019-02-13 6:32 ` [PATCH v4 1/6] RISC-V: Move free_initrd_mem() to kernel/setup.c Anup Patel
2019-02-13 6:32 ` [PATCH v4 2/6] RISC-V: Setup init_mm before parse_early_param() Anup Patel
2019-02-13 6:32 ` [PATCH v4 3/6] RISC-V: Move setup_bootmem() to mm/init.c Anup Patel
2019-02-13 6:32 ` [PATCH v4 4/6] RISC-V: Move setup_vm() " Anup Patel
2019-02-13 6:32 ` [PATCH v4 5/6] RISC-V: Implement compile-time fixed mappings Anup Patel
2019-02-13 6:32 ` [PATCH v4 6/6] RISC-V: Free-up initrd in free_initrd_mem() Anup Patel
2019-02-13 6:44 ` Christoph Hellwig
2019-02-13 7:38 ` Mike Rapoport [this message]
2019-02-13 7:49 ` Anup Patel
2019-02-13 17:54 ` Christoph Hellwig
2019-02-13 18:05 ` Mike Rapoport
[not found] ` <CGME20190213180621epcas4p44685b5689a3fcfbe63453e808f502548@epcms5p4>
2019-02-14 5:00 ` CHANDAN VN
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190213073835.GA18267@rapoport-lnx \
--to=rppt@linux.ibm.com \
--cc=Anup.Patel@wdc.com \
--cc=Atish.Patra@wdc.com \
--cc=aou@eecs.berkeley.edu \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@sifive.com \
--cc=paul.walmsley@sifive.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®