From: Kiryl Shutsemau <kirill@shutemov.name>
To: Lance Yang <lance.yang@linux.dev>
Cc: david@kernel.org, baolin.wang@linux.alibaba.com,
pedrodemargomes@gmail.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: Thu, 27 Aug 2026 15:07:10 +0100 [thread overview]
Message-ID: <apBB01VBbmV28gWP@thinkstation> (raw)
In-Reply-To: <20260827121151.7837-1-lance.yang@linux.dev>
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
--
Kiryl Shutsemau / Kirill A. Shutemov
next prev parent reply other threads:[~2026-08-27 14:07 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 [this message]
2026-08-31 18:53 ` Pedro Demarchi Gomes
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=apBB01VBbmV28gWP@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.