[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMZfGtVks41ZXaUgPdLyNqVCRYTvSm5qAN9GM5e0vqJ9YV7NdA@mail.gmail.com>
Date: Thu, 10 Dec 2020 20:26:28 +0800
From: Muchun Song <songmuchun@...edance.com>
To: Oscar Salvador <osalvador@...e.de>
Cc: Jonathan Corbet <corbet@....net>,
Mike Kravetz <mike.kravetz@...cle.com>,
Thomas Gleixner <tglx@...utronix.de>, mingo@...hat.com,
bp@...en8.de, x86@...nel.org, hpa@...or.com,
dave.hansen@...ux.intel.com, luto@...nel.org,
Peter Zijlstra <peterz@...radead.org>, viro@...iv.linux.org.uk,
Andrew Morton <akpm@...ux-foundation.org>, paulmck@...nel.org,
mchehab+huawei@...nel.org, pawan.kumar.gupta@...ux.intel.com,
Randy Dunlap <rdunlap@...radead.org>, oneukum@...e.com,
anshuman.khandual@....com, jroedel@...e.de,
Mina Almasry <almasrymina@...gle.com>,
David Rientjes <rientjes@...gle.com>,
Matthew Wilcox <willy@...radead.org>,
Michal Hocko <mhocko@...e.com>,
"Song Bao Hua (Barry Song)" <song.bao.hua@...ilicon.com>,
David Hildenbrand <david@...hat.com>,
Xiongchun duan <duanxiongchun@...edance.com>,
linux-doc@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
Linux Memory Management List <linux-mm@...ck.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>
Subject: Re: [External] Re: [PATCH v8 09/12] mm/hugetlb: Add a kernel
parameter hugetlb_free_vmemmap
On Thu, Dec 10, 2020 at 7:41 PM Oscar Salvador <osalvador@...e.de> wrote:
>
> On Thu, Dec 10, 2020 at 11:55:23AM +0800, Muchun Song wrote:
> > +hugetlb_free_vmemmap
> > + When CONFIG_HUGETLB_PAGE_FREE_VMEMMAP is set, this enables freeing
> > + unused vmemmap pages associated each HugeTLB page.
> ^^^ with
Thanks.
>
> > - if (end - start < PAGES_PER_SECTION * sizeof(struct page))
> > + if (is_hugetlb_free_vmemmap_enabled())
> > + err = vmemmap_populate_basepages(start, end, node, NULL);
> > + else if (end - start < PAGES_PER_SECTION * sizeof(struct page))
> > err = vmemmap_populate_basepages(start, end, node, NULL);
>
> Not sure if joining those in an OR makes se.se
Well, I can do it.
>
> > else if (boot_cpu_has(X86_FEATURE_PSE))
> > err = vmemmap_populate_hugepages(start, end, node, altmap);
> > @@ -1610,7 +1613,8 @@ void register_page_bootmem_memmap(unsigned long section_nr,
> > }
> > get_page_bootmem(section_nr, pud_page(*pud), MIX_SECTION_INFO);
> >
> > - if (!boot_cpu_has(X86_FEATURE_PSE)) {
> > + if (!boot_cpu_has(X86_FEATURE_PSE) ||
> > + is_hugetlb_free_vmemmap_enabled()) {
>
> I would add a variable at the beginning called "basepages_populated"
> that holds the result of those two conditions.
> I am not sure if it slightly improves the code as the conditions do
> not need to be rechecked, but the readibility a bit.
Agree. The condition does not need to be rechecked.
Will do in the next version. Thanks.
>
> > +bool hugetlb_free_vmemmap_enabled;
> > +
> > +static int __init early_hugetlb_free_vmemmap_param(char *buf)
> > +{
> > + if (!buf)
> > + return -EINVAL;
> > +
> > + /* We cannot optimize if a "struct page" crosses page boundaries. */
>
> I think this comment belongs to the last patch.
>
Thanks.
>
> --
> Oscar Salvador
> SUSE L3
--
Yours,
Muchun
Powered by blists - more mailing lists