linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] mm: Rework zap ptes on swap entries
@ 2022-01-28  4:54 Peter Xu
  2022-01-28  4:54 ` [PATCH v3 1/4] mm: Don't skip swap entry even if zap_details specified Peter Xu
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Peter Xu @ 2022-01-28  4:54 UTC (permalink / raw)
  To: linux-mm, linux-kernel
  Cc: peterx, Alistair Popple, Andrew Morton, Andrea Arcangeli,
	David Hildenbrand, Matthew Wilcox, John Hubbard, Hugh Dickins,
	Vlastimil Babka, Yang Shi, Kirill A . Shutemov

v3:
- Patch 1:
  - Fix !non_swap_entry() case and hwpoison case too [Hugh]
  - Added reproducer program in commit message
  - Introduced should_zap_cows() helper
- Added patch 2, "mm: Rename zap_skip_check_mapping() to should_zap_page()"
- Added patch 3, "mm: Change zap_details.zap_mapping into even_cows"

RFC V2: https://lore.kernel.org/lkml/20211115134951.85286-1-peterx@redhat.com
RFC V1: https://lore.kernel.org/lkml/20211110082952.19266-1-peterx@redhat.com

Thanks to Hugh's help, we're pretty clear on the history of zap_details and
swap skipping behavior, hence dropping the RFC tag.

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.

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 | 85 +++++++++++++++++++++++++++++++----------------------
 1 file changed, 50 insertions(+), 35 deletions(-)

-- 
2.32.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-01-28  9:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-28  4:54 [PATCH v3 0/4] mm: Rework zap ptes on swap entries Peter Xu
2022-01-28  4:54 ` [PATCH v3 1/4] mm: Don't skip swap entry even if zap_details specified Peter Xu
2022-01-28  4:54 ` [PATCH v3 2/4] mm: Rename zap_skip_check_mapping() to should_zap_page() Peter Xu
2022-01-28  8:16   ` David Hildenbrand
2022-01-28  8:53     ` Peter Xu
2022-01-28  4:54 ` [PATCH v3 3/4] mm: Change zap_details.zap_mapping into even_cows Peter Xu
2022-01-28  9:03   ` David Hildenbrand
2022-01-28  9:17     ` Peter Xu
2022-01-28  9:18       ` David Hildenbrand
2022-01-28  4:54 ` [PATCH v3 4/4] mm: Rework swap handling of zap_pte_range Peter Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).