From: Muchun Song <songmuchun@bytedance.com>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>,
Mike Kravetz <mike.kravetz@oracle.com>,
Andrew Morton <akpm@linux-foundation.org>,
Kees Cook <keescook@chromium.org>,
Iurii Zaikin <yzaikin@google.com>,
Linux Doc Mailing List <linux-doc@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Linux Memory Management List <linux-mm@kvack.org>,
Xiongchun duan <duanxiongchun@bytedance.com>,
Muchun Song <smuchun@gmail.com>,
Adam Manzanares <a.manzanares@samsung.com>,
Davidlohr Bueso <dave@stgolabs.net>
Subject: Re: [PATCH v2 3/3] mm: hugetlb: add hugetlb_free_vmemmap sysctl
Date: Thu, 3 Mar 2022 19:15:05 +0800 [thread overview]
Message-ID: <CAMZfGtUCPAc2Ff7Cg1oxo=JYMaX1GM3HVNvK_Nka+4j5Xg3AtA@mail.gmail.com> (raw)
In-Reply-To: <Yh/g2BRPZC3370mX@bombadil.infradead.org>
On Thu, Mar 3, 2022 at 5:25 AM Luis Chamberlain <mcgrof@kernel.org> wrote:
>
> On Wed, Mar 02, 2022 at 04:37:58PM +0800, Muchun Song wrote:
> > We must add "hugetlb_free_vmemmap=on" to boot cmdline and reboot the
> > server to enable the feature of freeing vmemmap pages of HugeTLB
> > pages. Rebooting usually taske a long time. Add a sysctl to enable
> > the feature at runtime and do not need to reboot.
> >
> > Signed-off-by: Muchun Song <songmuchun@bytedance.com>
> > ---
> > Documentation/admin-guide/sysctl/vm.rst | 13 ++++++++++
> > include/linux/memory_hotplug.h | 9 +++++++
> > mm/hugetlb_vmemmap.c | 42 ++++++++++++++++++++++++++++-----
> > mm/hugetlb_vmemmap.h | 4 +++-
> > mm/memory_hotplug.c | 5 ++++
> > 5 files changed, 66 insertions(+), 7 deletions(-)
> >
> > diff --git a/Documentation/admin-guide/sysctl/vm.rst b/Documentation/admin-guide/sysctl/vm.rst
> > index f4804ce37c58..01f18e6cc227 100644
> > --- a/Documentation/admin-guide/sysctl/vm.rst
> > +++ b/Documentation/admin-guide/sysctl/vm.rst
> > @@ -561,6 +561,19 @@ Change the minimum size of the hugepage pool.
> > See Documentation/admin-guide/mm/hugetlbpage.rst
> >
> >
> > +hugetlb_free_vmemmap
> > +====================
> > +
> > +A toggle value indicating if vmemmap pages are allowed to be optimized.
> > +If it is off (0), then it can be set true (1). Once true, the vmemmap
> > +pages associated with each HugeTLB page will be optimized, and the toggle
> > +cannot be set back to false. It only optimizes the subsequent allocation
> > +of HugeTLB pages from buddy system, while already allocated HugeTLB pages
> > +will not be optimized.
>
> The commit log or documentation does not descrie why its safe to toggle
> one way and not the other?
>
I thought it was easy to handle the transition from disable to enable
(code is simple). I might be wrong. I'll try to handle the other side in
the next version if it is not hard to handle.
Thanks Luis.
next prev parent reply other threads:[~2022-03-03 11:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-02 8:37 [PATCH v2 0/3] " Muchun Song
2022-03-02 8:37 ` [PATCH v2 1/3] mm: hugetlb: disable freeing vmemmap pages when struct page crosses page boundaries Muchun Song
2022-03-02 21:21 ` Luis Chamberlain
2022-03-03 2:38 ` Muchun Song
2022-03-03 0:25 ` Mike Kravetz
2022-03-03 2:28 ` Muchun Song
2022-03-02 8:37 ` [PATCH v2 2/3] sysctl: allow to set extra1 to SYSCTL_ONE Muchun Song
2022-03-02 8:37 ` [PATCH v2 3/3] mm: hugetlb: add hugetlb_free_vmemmap sysctl Muchun Song
2022-03-02 21:25 ` Luis Chamberlain
2022-03-03 11:15 ` Muchun Song [this message]
2022-03-03 14:59 ` Luis Chamberlain
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='CAMZfGtUCPAc2Ff7Cg1oxo=JYMaX1GM3HVNvK_Nka+4j5Xg3AtA@mail.gmail.com' \
--to=songmuchun@bytedance.com \
--cc=a.manzanares@samsung.com \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=dave@stgolabs.net \
--cc=duanxiongchun@bytedance.com \
--cc=keescook@chromium.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mcgrof@kernel.org \
--cc=mike.kravetz@oracle.com \
--cc=smuchun@gmail.com \
--cc=yzaikin@google.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