* [merged mm-stable] mm-use-a-folio-in-the-softleaf_is_device_private-path.patch removed from -mm tree
@ 2026-10-07 0:48 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-10-07 0:48 UTC (permalink / raw)
To: mm-commits, vbabka, surenb, rppt, mhocko, ljs, liam, david,
anshuman.khandual, lihongfu, akpm
The quilt patch titled
Subject: mm: use a folio in the softleaf_is_device_private path
has been removed from the -mm tree. Its filename was
mm-use-a-folio-in-the-softleaf_is_device_private-path.patch
This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Hongfu Li <lihongfu@kylinos.cn>
Subject: mm: use a folio in the softleaf_is_device_private path
Date: Wed, 19 Aug 2026 17:51:43 +0800
Use the folio APIs in the device_private migration path of do_swap_page(),
replacing four calls to compound_head() with two page_folio() calls. The
second one re-fetches the folio from vmf->page after migrate_to_ram(),
which might have split the folio.
Link: https://lore.kernel.org/20260819095144.45660-1-hongfu.li@linux.dev
Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Suggested-by: David Hildenbrand (Arm) <david@kernel.org>
Link: https://lore.kernel.org/all/e20678ed-3fa1-4677-a1d7-e2af481e8302@kernel.org/
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
---
mm/memory.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
--- a/mm/memory.c~mm-use-a-folio-in-the-softleaf_is_device_private-path
+++ a/mm/memory.c
@@ -4926,18 +4926,21 @@ vm_fault_t do_swap_page(struct vm_fault
goto unlock;
/*
- * Get a page reference while we know the page can't be
- * freed.
+ * Get a folio reference while we know the folio can't
+ * be freed.
*/
- if (trylock_page(vmf->page)) {
+ folio = page_folio(vmf->page);
+ if (folio_trylock(folio)) {
struct dev_pagemap *pgmap;
- get_page(vmf->page);
+ folio_get(folio);
pte_unmap_unlock(vmf->pte, vmf->ptl);
pgmap = page_pgmap(vmf->page);
ret = pgmap->ops->migrate_to_ram(vmf);
- unlock_page(vmf->page);
- put_page(vmf->page);
+ /* migrate_to_ram() might have split the folio. */
+ folio = page_folio(vmf->page);
+ folio_unlock(folio);
+ folio_put(folio);
} else {
pte_unmap(vmf->pte);
softleaf_entry_wait_on_locked(entry, vmf->ptl);
_
Patches currently in -mm which might be from lihongfu@kylinos.cn are
mm-page_owner-preserve-original-free_pid-free_tgid-during-folio-migration.patch
mm-memfd-fix-hugetlb-reservation-accounting-in-error-paths.patch
selftests-mm-fix-ptrace-peekdata-check-in-memfd_secret-test.patch
mm-hugetlb_cgroup-move-per-node-usage-on-cross-node-migration.patch
mm-hugetlb_cgroup-move-per-node-usage-on-cgroup-reparenting.patch
mm-hugetlb-account-migration-target-folio-in-per-node-nr_hugetlb-vmstat.patch
mm-memcg-migrate-per-node-hugetlb-lruvec-stat-together-with-hugetlb-folio.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-07 0:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-07 0:48 [merged mm-stable] mm-use-a-folio-in-the-softleaf_is_device_private-path.patch removed from -mm tree 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.