From: Kiryl Shutsemau <kirill@shutemov.name>
To: Pedro Demarchi Gomes <pedrodemargomes@gmail.com>
Cc: Lance Yang <lance.yang@linux.dev>,
david@kernel.org, baolin.wang@linux.alibaba.com,
akpm@linux-foundation.org, ljs@kernel.org, ziy@nvidia.com,
liam@infradead.org, nico.pache@linux.dev, ryan.roberts@arm.com,
dev.jain@arm.com, baohua@kernel.org, usama.arif@linux.dev,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH mm-stable] mm/khugepaged: avoid unnecessary checking for swap entries when collapsing a mTHP
Date: Wed, 2 Sep 2026 11:08:59 +0100 [thread overview]
Message-ID: <apf1iWLgwMUxnHp5@thinkstation> (raw)
In-Reply-To: <apXHC7uYXE99ZgPp@fedora>
On Mon, Aug 31, 2026 at 03:53:34PM -0300, Pedro Demarchi Gomes wrote:
> On Thu, Aug 27, 2026 at 03:07:10PM +0100, Kiryl Shutsemau wrote:
> > On Thu, Aug 27, 2026 at 08:11:51PM +0800, Lance Yang wrote:
> > > For the candidate above, the loop only reads its PTEs and returns
> > > SCAN_SUCCEED. Pedro's bitmap lets mthp_collapse() determine that upfront
> > > and skip the walk.
> > >
> > > Emm ... as I asked before[1], any numbers showing how much the extra scan
> > > costs?
> >
> > With the win being only some scan cost, I don't think it is going to be
> > measurable.
> >
> > It can open a path to future work. For example, we could find fully
> > populated mTHP windows in a PMD that is not eligible for collapse
> > because unmapped > max_ptes_swap. Right now we just give up on the whole
> > PMD in such cases.
> >
> > But there are more wins to gain there. Just saying :P
>
> Hi Kiryl,
>
> I devised a patch based on your proposed future work idea. If you think it
> makes sense, I can send it to the mailing list with a Suggested-by: tag.
I am not sure it is worth as the moment. There's lower handing fruits in
khugepaged that has to be addressed.
--
Kiryl Shutsemau / Kirill A. Shutemov
next prev parent reply other threads:[~2026-09-02 10:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-25 19:24 [PATCH mm-stable] mm/khugepaged: avoid unnecessary checking for swap entries when collapsing a mTHP Pedro Demarchi Gomes
2026-08-26 4:43 ` Lance Yang
2026-08-27 8:06 ` Baolin Wang
2026-08-27 11:02 ` David Hildenbrand (Arm)
2026-08-27 12:11 ` Lance Yang
2026-08-27 14:07 ` Kiryl Shutsemau
2026-08-31 18:53 ` Pedro Demarchi Gomes
2026-09-02 10:08 ` Kiryl Shutsemau [this message]
2026-08-28 3:24 ` Pedro Demarchi Gomes
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=apf1iWLgwMUxnHp5@thinkstation \
--to=kirill@shutemov.name \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@kernel.org \
--cc=dev.jain@arm.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=nico.pache@linux.dev \
--cc=pedrodemargomes@gmail.com \
--cc=ryan.roberts@arm.com \
--cc=usama.arif@linux.dev \
--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