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