From: Lance Yang <lance.yang@linux.dev>
To: akpm@linux-foundation.org, david@redhat.com, lorenzo.stoakes@oracle.com
Cc: ziy@nvidia.com, baolin.wang@linux.alibaba.com,
Liam.Howlett@oracle.com, npache@redhat.com, ryan.roberts@arm.com,
dev.jain@arm.com, baohua@kernel.org, ioworker0@gmail.com,
richard.weiyang@gmail.com, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: [PATCH mm-new v2 0/3] mm/khugepaged: refactor and merge PTE scanning logic
Date: Mon, 6 Oct 2025 22:43:35 +0800 [thread overview]
Message-ID: <20251006144338.96519-1-lance.yang@linux.dev> (raw)
Hi all,
This series cleans up the almost-duplicated PTE scanning logic in the
collapse path.
The first one is a preparatory step that refactors both loops to use
a single if-else-if-else-if chain for checking disjoint PTEs.
The second one replaces VM_BUG_ON_FOLIO() with a more graceful
VM_WARN_ON_FOLIO() for handling non-anonymous folios.
The last one then extracts the common logic into a shared helper.
Thanks,
Lance
---
v1 -> v2:
- #01 Update the changelog (per Dev)
- #01 Collect Reviewed-by from Wei, Dev and Zi - thanks!
- #03 Make more of the scanning logic common between scan_pmd() and
_isolate() (per Dev)
- https://lore.kernel.org/linux-mm/20251002073255.14867-1-lance.yang@linux.dev
Lance Yang (3):
mm/khugepaged: optimize PTE scanning with if-else-if-else-if chain
mm/khugepaged: use VM_WARN_ON_FOLIO instead of VM_BUG_ON_FOLIO for
non-anon folios
mm/khugepaged: merge PTE scanning logic into a new helper
mm/khugepaged.c | 243 ++++++++++++++++++++++++++----------------------
1 file changed, 131 insertions(+), 112 deletions(-)
--
2.49.0
next reply other threads:[~2025-10-06 14:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-06 14:43 Lance Yang [this message]
2025-10-06 14:43 ` [PATCH mm-new v2 1/3] mm/khugepaged: optimize PTE scanning with if-else-if-else-if chain Lance Yang
2025-10-06 14:43 ` [PATCH mm-new v2 2/3] mm/khugepaged: use VM_WARN_ON_FOLIO instead of VM_BUG_ON_FOLIO for non-anon folios Lance Yang
2025-10-07 0:35 ` Wei Yang
2025-10-07 4:39 ` Dev Jain
2025-10-06 14:43 ` [PATCH mm-new v2 3/3] mm/khugepaged: merge PTE scanning logic into a new helper Lance Yang
2025-10-07 6:28 ` Dev Jain
2025-10-07 8:32 ` Lance Yang
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=20251006144338.96519-1-lance.yang@linux.dev \
--to=lance.yang@linux.dev \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@redhat.com \
--cc=dev.jain@arm.com \
--cc=ioworker0@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=npache@redhat.com \
--cc=richard.weiyang@gmail.com \
--cc=ryan.roberts@arm.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