[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMZfGtVBqQNg_p6HBUFJYSK0ZrPDhGEk2T2muyecHwi=OOHZRA@mail.gmail.com>
Date: Thu, 11 Mar 2021 14:36:03 +0800
From: Muchun Song <songmuchun@...edance.com>
To: Michal Hocko <mhocko@...e.com>
Cc: Jonathan Corbet <corbet@....net>,
Mike Kravetz <mike.kravetz@...cle.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <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>,
Alexander Viro <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>,
Oscar Salvador <osalvador@...e.de>,
"Song Bao Hua (Barry Song)" <song.bao.hua@...ilicon.com>,
David Hildenbrand <david@...hat.com>,
HORIGUCHI NAOYA(堀口 直也)
<naoya.horiguchi@....com>,
Joao Martins <joao.m.martins@...cle.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>,
Miaohe Lin <linmiaohe@...wei.com>,
Chen Huang <chenhuang5@...wei.com>,
Bodeddula Balasubramaniam <bodeddub@...zon.com>
Subject: Re: [External] Re: [PATCH v18 6/9] mm: hugetlb: add a kernel
parameter hugetlb_free_vmemmap
On Wed, Mar 10, 2021 at 11:37 PM Michal Hocko <mhocko@...e.com> wrote:
>
> On Mon 08-03-21 18:28:04, Muchun Song wrote:
> > Add a kernel parameter hugetlb_free_vmemmap to enable the feature of
> > freeing unused vmemmap pages associated with each hugetlb page on boot.
> >
> > We disables PMD mapping of vmemmap pages for x86-64 arch when this
> > feature is enabled. Because vmemmap_remap_free() depends on vmemmap
> > being base page mapped.
> >
> > Signed-off-by: Muchun Song <songmuchun@...edance.com>
> > Reviewed-by: Oscar Salvador <osalvador@...e.de>
> > Reviewed-by: Barry Song <song.bao.hua@...ilicon.com>
> > Reviewed-by: Miaohe Lin <linmiaohe@...wei.com>
> > Tested-by: Chen Huang <chenhuang5@...wei.com>
> > Tested-by: Bodeddula Balasubramaniam <bodeddub@...zon.com>
> > ---
> > Documentation/admin-guide/kernel-parameters.txt | 14 ++++++++++++++
> > Documentation/admin-guide/mm/hugetlbpage.rst | 3 +++
> > arch/x86/mm/init_64.c | 8 ++++++--
> > include/linux/hugetlb.h | 19 +++++++++++++++++++
> > mm/hugetlb_vmemmap.c | 24 ++++++++++++++++++++++++
> > 5 files changed, 66 insertions(+), 2 deletions(-)
> >
> > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> > index 04545725f187..de91d54573c4 100644
> > --- a/Documentation/admin-guide/kernel-parameters.txt
> > +++ b/Documentation/admin-guide/kernel-parameters.txt
> > @@ -1557,6 +1557,20 @@
> > Documentation/admin-guide/mm/hugetlbpage.rst.
> > Format: size[KMG]
> >
> > + hugetlb_free_vmemmap=
> > + [KNL] When CONFIG_HUGETLB_PAGE_FREE_VMEMMAP is set,
> > + this controls freeing unused vmemmap pages associated
> > + with each HugeTLB page. When this option is enabled,
> > + we disable PMD/huge page mapping of vmemmap pages which
> > + increase page table pages. So if a user/sysadmin only
> > + uses a small number of HugeTLB pages (as a percentage
> > + of system memory), they could end up using more memory
> > + with hugetlb_free_vmemmap on as opposed to off.
> > + Format: { on | off (default) }
>
> Please note this is an admin guide and for those this seems overly low
OK.
> level. I would use something like the following
> [KNL] Reguires CONFIG_HUGETLB_PAGE_FREE_VMEMMAP
> enabled.
> Allows heavy hugetlb users to free up some more
> memory (6 * PAGE_SIZE for each 2MB hugetlb
> page).
> This feauture is not free though. Large page
> tables are not use to back vmemmap pages which
> can lead to a performance degradation for some
> workloads. Also there will be memory allocation
> required when hugetlb pages are freed from the
> pool which can lead to corner cases under heavy
> memory pressure.
Very thanks. I will update this.
> > +
> > + on: enable the feature
> > + off: disable the feature
> > +
> > hung_task_panic=
> > [KNL] Should the hung task detector generate panics.
> > Format: 0 | 1
> --
> Michal Hocko
> SUSE Labs
Powered by blists - more mailing lists