[merged mm-stable] mm-migrate-use-migrate_info-field-instead-of-private.patch removed from -mm tree
Andrew Morton <[email protected]> Tue, 28 Jul 2026 21:13:55 -0700
| Newsgroups | org.kernel.vger.mm-commits |
|---|---|
| Message-ID | <[email protected]> |
The quilt patch titled
Subject: mm/migrate: use migrate_info field instead of private
has been removed from the -mm tree. Its filename was
mm-migrate-use-migrate_info-field-instead-of-private.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: Shivank Garg <[email protected]>
Subject: mm/migrate: use migrate_info field instead of private
Date: Wed, 1 Jul 2026 05:17:22 +0000
Add an unsigned long migrate_info member to the struct folio union and use
it to store migration state (anon_vma pointer and FOLIO_WAS_* markers)
instead of using folio->private. While at it, switch to bitwise OR.
No functional change.
[[email protected]: add missing kernel-doc for @migrate_info]
Link: https://lore.kernel.org/[email protected]
Link: https://lore.kernel.org/[email protected]
Signed-off-by: Shivank Garg <[email protected]>
Suggested-by: David Hildenbrand (Arm) <[email protected]>
Reviewed-by: Jonathan Cameron <[email protected]>
Acked-by: David Hildenbrand (Arm) <[email protected]>
Reviewed-by: Huang Ying <[email protected]>
Acked-by: Zi Yan <[email protected]>
Reviewed-by: SJ Park <[email protected]>
Signed-off-by: Randy Dunlap <[email protected]>
Cc: Alistair Popple <[email protected]>
Cc: Byungchul Park <[email protected]>
Cc: Dev Jain <[email protected]>
Cc: Gregory Price <[email protected]>
Cc: Joshua Hahn <[email protected]>
Cc: Liam R. Howlett <[email protected]>
Cc: Lorenzo Stoakes <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: Rakie Kim <[email protected]>
Cc: Suren Baghdasaryan <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
---
include/linux/mm_types.h | 3 +++
mm/migrate.c | 14 +++++++-------
2 files changed, 10 insertions(+), 7 deletions(-)
--- a/include/linux/mm_types.h~mm-migrate-use-migrate_info-field-instead-of-private
+++ a/include/linux/mm_types.h
@@ -368,6 +368,8 @@ typedef unsigned short mm_id_t;
* dax_associate_entry.
* @private: Filesystem per-folio data (see folio_attach_private()).
* @swap: Used for swp_entry_t if folio_test_swapcache().
+ * @migrate_info: Stores migration state (anon_vma pointer and
+ * FOLIO_WAS_* markers).
* @_mapcount: Do not access this member directly. Use folio_mapcount() to
* find out how many times this folio is mapped by userspace.
* @_refcount: Do not access this member directly. Use folio_ref_count()
@@ -427,6 +429,7 @@ struct folio {
union {
void *private;
swp_entry_t swap;
+ unsigned long migrate_info;
};
atomic_t _mapcount;
atomic_t _refcount;
--- a/mm/migrate.c~mm-migrate-use-migrate_info-field-instead-of-private
+++ a/mm/migrate.c
@@ -1130,7 +1130,7 @@ static int move_to_new_folio(struct foli
}
/*
- * To record some information during migration, we use unused private
+ * To record some information during migration, we use the migrate_info
* field of struct folio of the newly allocated destination folio.
* This is safe because nobody is using it except us.
*/
@@ -1143,17 +1143,17 @@ enum {
static void __migrate_folio_record(struct folio *dst,
int old_folio_state, struct anon_vma *anon_vma)
{
- dst->private = (void *)anon_vma + old_folio_state;
+ dst->migrate_info = (unsigned long)anon_vma | old_folio_state;
}
static void __migrate_folio_extract(struct folio *dst,
int *old_folio_state, struct anon_vma **anon_vmap)
{
- unsigned long private = (unsigned long)dst->private;
+ unsigned long info = dst->migrate_info;
- *anon_vmap = (struct anon_vma *)(private & ~FOLIO_OLD_STATES);
- *old_folio_state = private & FOLIO_OLD_STATES;
- dst->private = NULL;
+ *anon_vmap = (struct anon_vma *)(info & ~FOLIO_OLD_STATES);
+ *old_folio_state = info & FOLIO_OLD_STATES;
+ dst->migrate_info = 0;
}
/* Restore the source folio to the original state upon failure */
@@ -1214,7 +1214,7 @@ static int migrate_folio_unmap(new_folio
return -ENOMEM;
*dstp = dst;
- dst->private = NULL;
+ dst->migrate_info = 0;
if (!folio_trylock(src)) {
if (mode == MIGRATE_ASYNC)
_
Patches currently in -mm which might be from [email protected] are