* + mm-migrate_device-try-to-handle-swapcache-pages.patch added to mm-unstable branch
@ 2023-07-03 0:19 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2023-07-03 0:19 UTC (permalink / raw)
To: mm-commits, ying.huang, rcampbell, jhubbard, apopple, mpenttil,
akpm
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2861 bytes --]
The patch titled
Subject: mm/migrate_device: try to handle swapcache pages
has been added to the -mm mm-unstable branch. Its filename is
mm-migrate_device-try-to-handle-swapcache-pages.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-migrate_device-try-to-handle-swapcache-pages.patch
This patch will later appear in the mm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Mika Penttilä <mpenttil@redhat.com>
Subject: mm/migrate_device: try to handle swapcache pages
Date: Wed, 7 Jun 2023 20:29:44 +0300
Migrating file pages and swapcache pages into device memory is not
supported. Try to get rid of the swap cache, and if successful, go ahead
as with other anonymous pages.
Link: https://lkml.kernel.org/r/20230607172944.11713-1-mpenttil@redhat.com
Signed-off-by: Mika Penttilä <mpenttil@redhat.com>
Reviewed-by: "Huang, Ying" <ying.huang@intel.com>
Reviewed-by: Alistair Popple <apopple@nvidia.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Ralph Campbell <rcampbell@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/migrate_device.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
--- a/mm/migrate_device.c~mm-migrate_device-try-to-handle-swapcache-pages
+++ a/mm/migrate_device.c
@@ -727,13 +727,22 @@ static void __migrate_device_pages(unsig
if (is_device_private_page(newpage) ||
is_device_coherent_page(newpage)) {
- /*
- * For now only support anonymous memory migrating to
- * device private or coherent memory.
- */
if (mapping) {
- src_pfns[i] &= ~MIGRATE_PFN_MIGRATE;
- continue;
+ struct folio *folio;
+
+ folio = page_folio(page);
+
+ /*
+ * For now only support anonymous memory migrating to
+ * device private or coherent memory.
+ *
+ * Try to get rid of swap cache if possible.
+ */
+ if (!folio_test_anon(folio) ||
+ !folio_free_swap(folio)) {
+ src_pfns[i] &= ~MIGRATE_PFN_MIGRATE;
+ continue;
+ }
}
} else if (is_zone_device_page(newpage)) {
/*
_
Patches currently in -mm which might be from mpenttil@redhat.com are
mm-migrate_device-try-to-handle-swapcache-pages.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-07-03 0:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-03 0:19 + mm-migrate_device-try-to-handle-swapcache-pages.patch added to mm-unstable branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.