* [merged mm-hotfixes-stable] mm-zone_device-do-not-touch-device-folio-after-calling-folio_free.patch removed from -mm tree
@ 2026-04-19 6:25 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-04-19 6:25 UTC (permalink / raw)
To: mm-commits, vishal.moola, stable, osalvador, david, balbirs,
apopple, matthew.brost, akpm
The quilt patch titled
Subject: mm/zone_device: do not touch device folio after calling ->folio_free()
has been removed from the -mm tree. Its filename was
mm-zone_device-do-not-touch-device-folio-after-calling-folio_free.patch
This patch was dropped because it was merged into the mm-hotfixes-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Matthew Brost <matthew.brost@intel.com>
Subject: mm/zone_device: do not touch device folio after calling ->folio_free()
Date: Fri, 10 Apr 2026 16:03:46 -0700
The contents of a device folio can immediately change after calling
->folio_free(), as the folio may be reallocated by a driver with a
different order. Instead of touching the folio again to extract the
pgmap, use the local stack variable when calling percpu_ref_put_many().
Link: https://lore.kernel.org/20260410230346.4009855-1-matthew.brost@intel.com
Fixes: d245f9b4ab80 ("mm/zone_device: support large zone device private folios")
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Balbir Singh <balbirs@nvidia.com>
Reviewed-by: Vishal Moola <vishal.moola@gmail.com>
Reviewed-by: Alistair Popple <apopple@nvidia.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/memremap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/mm/memremap.c~mm-zone_device-do-not-touch-device-folio-after-calling-folio_free
+++ a/mm/memremap.c
@@ -454,7 +454,7 @@ void free_zone_device_folio(struct folio
if (WARN_ON_ONCE(!pgmap->ops || !pgmap->ops->folio_free))
break;
pgmap->ops->folio_free(folio);
- percpu_ref_put_many(&folio->pgmap->ref, nr);
+ percpu_ref_put_many(&pgmap->ref, nr);
break;
case MEMORY_DEVICE_GENERIC:
_
Patches currently in -mm which might be from matthew.brost@intel.com are
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-04-19 6:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-19 6:25 [merged mm-hotfixes-stable] mm-zone_device-do-not-touch-device-folio-after-calling-folio_free.patch removed from -mm tree Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox