linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Guo Ren <guoren@kernel.org>
To: Mike Rapoport <rppt@kernel.org>
Cc: David Hildenbrand <david@redhat.com>,
	 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux-MM <linux-mm@kvack.org>,
	 linux-csky@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	 Oscar Salvador <osalvador@suse.de>,
	Michal Hocko <mhocko@kernel.org>,
	 Wei Yang <richard.weiyang@linux.alibaba.com>
Subject: Re: [PATCH v1] csky: use free_initmem_default() in free_initmem()
Date: Wed, 27 Jan 2021 15:52:25 +0800	[thread overview]
Message-ID: <CAJF2gTRsqZ4DTvZm2V9VRKP_f6u-p5aupCjrvuGy_7m8tiQQVQ@mail.gmail.com> (raw)
In-Reply-To: <20210126182648.GR6332@kernel.org>

Thx Mike,

It's under test:
https://gitlab.com/c-sky/buildroot/-/pipelines/247353584

kernel:
https://github.com/c-sky/csky-linux/commit/9d986b01feb991ded3fb8c1f8153a0c80ea84b9c

On Wed, Jan 27, 2021 at 2:26 AM Mike Rapoport <rppt@kernel.org> wrote:
>
> On Tue, Jan 26, 2021 at 07:14:20PM +0100, David Hildenbrand wrote:
> > The existing code is essentially
> > free_initmem_default()->free_reserved_area() without poisoning.
> >
> > Note that existing code missed to update the managed page count of the
> > zone.
> >
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Cc: Guo Ren <guoren@kernel.org>
> > Cc: Mike Rapoport <rppt@kernel.org>
> > Cc: Oscar Salvador <osalvador@suse.de>
> > Cc: Michal Hocko <mhocko@kernel.org>
> > Cc: Wei Yang <richard.weiyang@linux.alibaba.com>
> > Signed-off-by: David Hildenbrand <david@redhat.com>
> > ---
> >
> > Not compile tested as documentation on how to get
> >       https://gitlab.com/c-sky/buildroot
> > running, especially with a custom kernel, is a bit sparse.
>
> You can pick a cross-compiler from here:
>
> https://mirrors.edge.kernel.org/pub/tools/crosstool/
>
> > ---
> >  arch/csky/mm/init.c | 17 +----------------
> >  1 file changed, 1 insertion(+), 16 deletions(-)
> >
> > diff --git a/arch/csky/mm/init.c b/arch/csky/mm/init.c
> > index 81e4e5e78f38..894050a8ce09 100644
> > --- a/arch/csky/mm/init.c
> > +++ b/arch/csky/mm/init.c
> > @@ -110,24 +110,9 @@ void __init mem_init(void)
> >       mem_init_print_info(NULL);
> >  }
> >
> > -extern char __init_begin[], __init_end[];
> > -
> >  void free_initmem(void)
> >  {
> > -     unsigned long addr;
> > -
> > -     addr = (unsigned long) &__init_begin;
> > -
> > -     while (addr < (unsigned long) &__init_end) {
> > -             ClearPageReserved(virt_to_page(addr));
> > -             init_page_count(virt_to_page(addr));
> > -             free_page(addr);
> > -             totalram_pages_inc();
> > -             addr += PAGE_SIZE;
> > -     }
> > -
> > -     pr_info("Freeing unused kernel memory: %dk freed\n",
> > -     ((unsigned int)&__init_end - (unsigned int)&__init_begin) >> 10);
> > +     free_initmem_default(-1);
> >  }
> >
> >  void pgd_init(unsigned long *p)
> > --
> > 2.29.2
> >
>
> --
> Sincerely yours,
> Mike.



-- 
Best Regards
 Guo Ren

ML: https://lore.kernel.org/linux-csky/


  reply	other threads:[~2021-01-27  7:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26 18:14 David Hildenbrand
2021-01-26 18:26 ` Mike Rapoport
2021-01-27  7:52   ` Guo Ren [this message]
2021-01-27  8:49     ` David Hildenbrand
2021-01-27  9:06       ` Guo Ren

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=CAJF2gTRsqZ4DTvZm2V9VRKP_f6u-p5aupCjrvuGy_7m8tiQQVQ@mail.gmail.com \
    --to=guoren@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-csky@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=osalvador@suse.de \
    --cc=richard.weiyang@linux.alibaba.com \
    --cc=rppt@kernel.org \
    /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