mm-zone_device-do-not-touch-device-folio-after-calling-folio_free.patch removed from -mm tree
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 <[email protected]>
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().
---
mm/memremap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memremap.c renamed from mm/memremap.c~mm-zone_device-do-not-touch-device-folio-after-calling-folio_free +1 -1
@@ -454,7 +454,7 @@ void free_zone_device_folio(struct folioif (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 [email protected] are