[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211110082952.19266-1-peterx@redhat.com>
Date: Wed, 10 Nov 2021 16:29:50 +0800
From: Peter Xu <peterx@...hat.com>
To: linux-kernel@...r.kernel.org, linux-mm@...ck.org
Cc: peterx@...hat.com, Andrew Morton <akpm@...ux-foundation.org>,
Yang Shi <shy828301@...il.com>,
Hugh Dickins <hughd@...gle.com>,
David Hildenbrand <david@...hat.com>,
Alistair Popple <apopple@...dia.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Vlastimil Babka <vbabka@...e.cz>,
"Kirill A . Shutemov" <kirill@...temov.name>
Subject: [PATCH RFC 0/2] mm: Rework zap ptes on swap entries
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
Powered by blists - more mailing lists