linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC v2 0/2] mm: Rework zap ptes on swap entries
@ 2021-11-15 13:49 Peter Xu
  2021-11-15 13:49 ` [PATCH RFC v2 1/2] mm: Don't skip swap entry even if zap_details specified Peter Xu
  2021-11-15 13:49 ` [PATCH RFC v2 2/2] mm: Rework swap handling of zap_pte_range Peter Xu
  0 siblings, 2 replies; 27+ messages in thread
From: Peter Xu @ 2021-11-15 13:49 UTC (permalink / raw)
  To: linux-kernel, linux-mm
  Cc: David Hildenbrand, peterx, Andrea Arcangeli, Yang Shi,
	Vlastimil Babka, Hugh Dickins, Andrew Morton, Alistair Popple,
	Kirill A . Shutemov

v2:
- Resend to rebase to tag v5.16-rc1 (fa55b7dcdc43)

The goal of this small series is to replace the previous patch (which is the
5th patch of the series):

https://lore.kernel.org/linux-mm/20210908163628.215052-1-peterx@redhat.com/

This patch used a more aggresive (but IMHO cleaner and correct..) approach by
removing that trick to skip swap entries, then we handle swap entries always.

The behavior of "skipping swap entries" existed starting from the initial git
commit that we'll try to skip swap entries when zapping ptes if zap_detail
pointer specified.

I found that it's probably broken because of the introduction of page migration
mechanism that does not exist yet in the world of 1st git commit, then we could
errornously skip scanning the swap entries for file-backed memory, like shmem,
while we should.  I'm afraid we'll have RSS accounting wrong for those shmem
pages during migration so there could have leftover SHMEM RSS accounts.

Patch 1 did that removal of the trick, details in the commit message.

Patch 2 is a further cleanup for zap pte swap handling that can be done after
patch 1, in which there's no functional change intended.

The change should be on the slow path for zapping swap entries (e.g., we handle
none/present ptes in early code path always, so they're totally not affected),
but if anyone worries about specific workload that may be affected by this
patchset, please let me know and I'll be happy to run some more tests.  I could
also overlook something that was buried in history, in that case please kindly
point that out.  Marking the patchset RFC for this.

Smoke tested only.  Please review, thanks.

Peter Xu (2):
  mm: Don't skip swap entry even if zap_details specified
  mm: Rework swap handling of zap_pte_range

 mm/memory.c | 31 ++++++++++---------------------
 1 file changed, 10 insertions(+), 21 deletions(-)

-- 
2.32.0


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

end of thread, other threads:[~2022-01-24 11:02 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15 13:49 [PATCH RFC v2 0/2] mm: Rework zap ptes on swap entries Peter Xu
2021-11-15 13:49 ` [PATCH RFC v2 1/2] mm: Don't skip swap entry even if zap_details specified Peter Xu
2021-12-02 11:06   ` Alistair Popple
2021-12-03  3:21     ` Peter Xu
2021-12-03  5:33       ` Alistair Popple
2021-12-03  6:59         ` Peter Xu
2022-01-09  1:19   ` Hugh Dickins
2022-01-12 13:18     ` Peter Xu
2022-01-12 13:26       ` Peter Xu
2022-01-13  3:47         ` Hugh Dickins
2022-01-20 10:32           ` Peter Xu
2022-01-21  3:11             ` Peter Xu
2022-01-21  5:11               ` Peter Xu
2022-01-24  6:51                 ` Hugh Dickins
2022-01-24  9:13                   ` Peter Xu
2022-01-24  6:29             ` Hugh Dickins
2022-01-24  8:54               ` Peter Xu
2022-01-24 11:01                 ` Peter Xu
2022-01-10  8:37   ` David Hildenbrand
2022-01-11  7:40     ` Alistair Popple
2022-01-11  9:00       ` David Hildenbrand
2021-11-15 13:49 ` [PATCH RFC v2 2/2] mm: Rework swap handling of zap_pte_range Peter Xu
2021-11-15 13:57   ` Matthew Wilcox
2021-11-16  5:06     ` Peter Xu
2021-11-16  8:51     ` John Hubbard
2021-11-16 13:11       ` Matthew Wilcox
2021-11-16 19:06         ` John Hubbard

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).