Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Luka Bai <lukafocus@icloud.com>
To: Nico Pache <npache@redhat.com>
Cc: David Hildenbrand <david@kernel.org>,
	David Rientjes <rientjes@google.com>,
	linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	Lorenzo Stoakes <ljs@kernel.org>, Zi Yan <ziy@nvidia.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	"Liam R. Howlett" <liam@infradead.org>,
	Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>,
	Barry Song <baohua@kernel.org>, Lance Yang <lance.yang@linux.dev>,
	Vlastimil Babka <vbabka@kernel.org>,
	Mike Rapoport <rppt@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>, Kairui Song <kasong@tencent.com>,
	Qi Zheng <qi.zheng@linux.dev>,
	Shakeel Butt <shakeel.butt@linux.dev>,
	Axel Rasmussen <axelrasmussen@google.com>,
	Yuanchu Xie <yuanchu@google.com>, Wei Xu <weixugc@google.com>,
	Rik van Riel <riel@surriel.com>, Harry Yoo <harry@kernel.org>,
	Jann Horn <jannh@google.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	linux-kernel@vger.kernel.org, Luka Bai <lukabai@tencent.com>
Subject: Re: [PATCH 0/5] mm/khugepaged: add collapse hint machanism for khugepaged and use in mglru
Date: Thu, 11 Jun 2026 11:07:08 +0800	[thread overview]
Message-ID: <aiomXLJueg412S_I@LUKABAI-MC1> (raw)
In-Reply-To: <CAA1CXcCLwS=3CY48oFDMUsHEkBkJzLWQJke41PMQE65k2DdR-g@mail.gmail.com>

在 Tue, Jun 09, 2026 at 04:17:45AM -0600,Nico Pache 写道:

Hi Nico,

Thanks for the reply. :)

> On Sat, May 30, 2026 at 10:33 PM Luka Bai <lukafocus@icloud.com> wrote:
> 
> Hi Luka,
> 
> I haven't reviewed the code yet, but the overall concept is
> interesting (it should probably be a RFC first though, but that's
> fine).
> 

Sorry for the RFC mistake that I made. I didn't know the difference between
an RFC submission and a normal one. I'll use the correct type from now on.
Thanks for reminding me :)

> I had future plans for something similar as part of the thp=auto work;
> however that requires significant thought and investigation into how
> we can properly gather hints for collapse/split THP candidates. From
> my perspective we'd want a more global structure/system outside of
> khugepaged, that would directly call khugepaged (and others like
> split, etc). It would also tie into the allocator so that at fault
> time it could leverage the hints to make better decisions. My fear
> with this series is that making a decision now might complicate future
> work by adding complexity we may eventually want to remove for a
> better solution.
> 
> If you have the chance perhaps you can lead a discussion on your
> proposal at the biweekly MM alignment session.
> 
> +David Rientjes as he leads those discussions. We could use that time
> to layout a plan for what needs to be done for this work, and for the
> work surrounding thp=auto as I beleive they will be interdependent :)

That is a great idea! I also believe that we should improve THP in all sorts
of places like page allocation to use THP more precisely and more easily,
considering the fraction problem that is common when the machine runs. After
all, our goal is to maximize the benifit that THP can give by optimizing all
the routes :). Actually I've prepared another patchset that gives THP the
ability to be reserved based on migratetype so that we can reduce the fraction
of THP folios, and was considering discussing it with the upstream. But I
guess I'll postpone it after the reconstruction of THP code base as proposed by
Lorenzo :). I'm very interested in these discussions about the THP hints or
auto and reconstructions. Maybe we can use the THP cabal meeting mentioned by
Lorenzo for the discussion? Any approach is fine for me. Thanks. :)

> 
> Cheers,
> -- Nico
> 
> >
> > Signed-off-by: Luka Bai <lukabai@tencent.com>
> > ---
> > Luka Bai (5):
> >       mm/khugepaged: add framework for khugepaged collapse hint
> >       mm/khugepaged: use slab cache instead of normal kmalloc
> >       mm/khugepaged: add deduplication when adding new collapse hint
> >       mm/khugepaged: add accounting for successful hint or non-hint collapse
> >       mm/khugepaged: add khugepaged collapse hint in mglru reference checking
> >
> >  include/linux/huge_mm.h    |   2 +
> >  include/linux/khugepaged.h |  20 ++
> >  include/linux/mmzone.h     |  17 +-
> >  mm/huge_memory.c           |   4 +
> >  mm/khugepaged.c            | 460 ++++++++++++++++++++++++++++++++++++++++++++-
> >  mm/rmap.c                  |  27 ++-
> >  mm/vmscan.c                |  33 +++-
> >  7 files changed, 549 insertions(+), 14 deletions(-)
> > ---
> > base-commit: e1af79f3291a268adf4e149e1faba3052743e898
> > change-id: 20260530-thp_collapse_hint-ec92bd943797
> >
> > Best regards,
> > --
> > Luka Bai <lukabai@tencent.com>
> >
>

Best regards,
Luka


  parent reply	other threads:[~2026-06-11  3:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-31  4:27 [PATCH 0/5] mm/khugepaged: add collapse hint machanism for khugepaged and use in mglru Luka Bai
2026-05-31  4:27 ` [PATCH 1/5] mm/khugepaged: add framework for khugepaged collapse hint Luka Bai
2026-05-31  4:27 ` [PATCH 2/5] mm/khugepaged: use slab cache instead of normal kmalloc Luka Bai
2026-05-31  4:27 ` [PATCH 3/5] mm/khugepaged: add deduplication when adding new collapse hint Luka Bai
2026-05-31  4:27 ` [PATCH 4/5] mm/khugepaged: add accounting for successful hint or non-hint collapse Luka Bai
2026-05-31  4:27 ` [PATCH 5/5] mm/khugepaged: add khugepaged collapse hint in mglru reference checking Luka Bai
2026-06-09 10:17 ` [PATCH 0/5] mm/khugepaged: add collapse hint machanism for khugepaged and use in mglru Nico Pache
2026-06-09 14:44   ` Lorenzo Stoakes
2026-06-11  9:23     ` Karim Manaouil
2026-06-11 15:14       ` Zi Yan
2026-06-11 17:16         ` Matthew Wilcox
2026-06-12  1:01           ` Luka Bai
2026-06-11  3:07   ` Luka Bai [this message]
2026-06-09 16:06 ` Lorenzo Stoakes
2026-06-11  3:39   ` Luka Bai
  -- strict thread matches above, loose matches on Subject: below --
2026-05-31  4:23 Luka Bai
2026-05-31  4:40 ` Luka Bai

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=aiomXLJueg412S_I@LUKABAI-MC1 \
    --to=lukafocus@icloud.com \
    --cc=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=david@kernel.org \
    --cc=dev.jain@arm.com \
    --cc=hannes@cmpxchg.org \
    --cc=harry@kernel.org \
    --cc=jannh@google.com \
    --cc=kasong@tencent.com \
    --cc=lance.yang@linux.dev \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=lukabai@tencent.com \
    --cc=mhocko@suse.com \
    --cc=npache@redhat.com \
    --cc=qi.zheng@linux.dev \
    --cc=riel@surriel.com \
    --cc=rientjes@google.com \
    --cc=rppt@kernel.org \
    --cc=ryan.roberts@arm.com \
    --cc=shakeel.butt@linux.dev \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=weixugc@google.com \
    --cc=yuanchu@google.com \
    --cc=ziy@nvidia.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