MM: Tighten control over zero-page remapping
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 26 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | mm/ksm: export ksm_is_running() to check KSM merge stateinclude/ mm/ | +12 | 1 reply | |
| 2/3 | mm/migrate.c: Prevent folio splitting from interacting with KSMmm/ | +9 | 25 replies | |
| 3/3 | mm/huge_memory.c: Skip zero-page remapping when underused THP shrinker is disabledmm/ | +1 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH mm-unstable v1 0/3] MM: Tighten control over zero-page remapping
This patch series fixes a bug in KSM where the pages_to_scan limit is bypassed and the policy (use_zero_pages) is ignored. It also gives users further control of the zero-page remapping that occurs when a folio is split.
Commit b1f202060afe ("mm: remap unused subpages to shared zeropage when splitting isolated thp") added unconditional zero-page remapping when a folio is split. This was sold as part of the underutilized shrinker, but has a larger effect. Since this commit, all splits do this zero-page scanning and remapping, even if the user has the underutilized shrinker disabled.
This unconditional zero-page remapping was also problematic for KSM, as when KSM would try to merge a page, it would split the folio and the zero-page remapping would remap all zero-filled pages to the shared zero-page bypassing the use_zero_pages policy. When the user had this feature disabled, KSM would then waste cycles scanning these already freed pages, causing little progress to be made, and KSMs performance to degrade.
In this series we also gate the zero-page remapping behind split_underused_thp (the sysfs for the underutilized shrinker). This provides users with more control over this behavior, while also preventing the KSM bug when it is enabled.
RFC: https://lore.kernel.org/all/[email protected]/
Nico Pache (3):
mm/ksm: export ksm_is_running() to check KSM merge state mm/migrate.c: Prevent folio splitting from interacting with KSM mm/huge_memory.c: Skip zero-page remapping when underused THP shrinker
is disabled
include/linux/ksm.h | 6 ++++++ mm/huge_memory.c | 2 +- mm/ksm.c | 6 ++++++ mm/migrate.c | 9 +++++++++ 4 files changed, 22 insertions(+), 1 deletion(-)
base-commit: be18cf77e1e749c6469ff44df00eb026f7c0a365
Signature · 1 line
2.54.0