From: Pedro Demarchi Gomes <pedrodemargomes@gmail.com>
To: Kiryl Shutsemau <kirill@shutemov.name>
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: Mon, 31 Aug 2026 15:53:34 -0300 [thread overview]
Message-ID: <apXHC7uYXE99ZgPp@fedora> (raw)
In-Reply-To: <apBB01VBbmV28gWP@thinkstation>
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.
Thanks!
next prev parent reply other threads:[~2026-08-31 18:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-25 19:24 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 [this message]
2026-09-02 10:08 ` Kiryl Shutsemau
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=apXHC7uYXE99ZgPp@fedora \
--to=pedrodemargomes@gmail.com \
--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=kirill@shutemov.name \
--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=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
all inboxes | Powered by JetHome®