Skip to content

mm: Rework zap ptes on swap entries

Peter Xu linux-mm lkml 5 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest4 patches 0 repliesNew
  2. v44 patches 10 repliesSuperseded 3 of 4 applied
  3. v34 patches 5 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v2 RFC2 patches24 repliesSuperseded
v1 RFC2 patches2 repliesSuperseded

Changes in v5 from the cover letter

- Patch 1:
- A few comment fixups in patch 1 [John]
- Tweak commit message (s/user/caller/) [Andrew]
- Add r-bs for John
- Reindent commit messages to 75 columns [John]

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4mm: Don't skip swap entry even if zap_details specifiedmm/memory.c+31 -90 replies
2/4mm: Rename zap_skip_check_mapping() to should_zap_page()mm/memory.c+8 -90 replies
3/4mm: Change zap_details.zap_mapping into even_cowsmm/memory.c+7 -90 replies
4/4mm: Rework swap handling of zap_pte_rangemm/memory.c+6 -150 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchJohn HubbardDavid Hildenbrand
1/4R-b
2/4R-b R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/4] mm: Rework zap ptes on swap entries

v5:
- Patch 1:
- A few comment fixups in patch 1 [John]
- Tweak commit message (s/user/caller/) [Andrew]
- Add r-bs for John
- Reindent commit messages to 75 columns [John]

RFC V1: https://lore.kernel.org/lkml/[email protected]
RFC V2: https://lore.kernel.org/lkml/[email protected]
V3:     https://lore.kernel.org/lkml/[email protected]
V4:     https://lore.kernel.org/lkml/[email protected]

Patch 1 should fix a long standing bug for zap_pte_range() on zap_details usage. The risk is we could have some swap entries skipped while we should have zapped them.

Migration entries are not the major concern because file backed memory always zap in the pattern that "first time without page lock, then re-zap with page lock" hence the 2nd zap will always make sure all migration entries are already recovered.

However there can be issues with real swap entries got skipped errornoously. There's a reproducer provided in commit message of patch 1 for that.

Patch 2-4 are cleanups that are based on patch 1. After the whole patchset applied, we should have a very clean view of zap_pte_range().

Only patch 1 needs to be backported to stable if necessary.

Please review, thanks.

Peter Xu (4):
mm: Don't skip swap entry even if zap_details specified
mm: Rename zap_skip_check_mapping() to should_zap_page()
mm: Change zap_details.zap_mapping into even_cows
mm: Rework swap handling of zap_pte_range

 mm/memory.c | 80 ++++++++++++++++++++++++++++++-----------------------
 1 file changed, 45 insertions(+), 35 deletions(-)
Signature · 1 line
2.32.0