mm/page_owner: preserve original free_pid/free_tgid during folio migration

__update_page_owner_free_handle() accepts pid and tgid, but ignores them,
always storing current->pid and current->tgid.

__folio_copy_owner() forwards the original free pid/tgid during folio
migration, yet these values were overwritten by the migrating task.

Store the passed-in pid/tgid so the migrated folio keeps the original free
attribution.

Link: https://lore.kernel.org/[email protected]
Signed-off-by: Hongfu Li <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Acked-by: Vlastimil Babka (SUSE) <[email protected]>
Cc: Brendan Jackman <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Suren Baghdasaryan <[email protected]>
Cc: Zi Yan <[email protected]>
This commit is contained in:
Hongfu Li
2026-10-08 22:54:34 -07:00
committed by Andrew Morton
parent 600c820b8e
commit e1e8650302
+2 -2
View File
@@ -307,8 +307,8 @@ static inline void __update_page_owner_free_handle(struct page *page,
page_owner->free_handle = handle;
}
page_owner->free_ts_nsec = free_ts_nsec;
page_owner->free_pid = current->pid;
page_owner->free_tgid = current->tgid;
page_owner->free_pid = pid;
page_owner->free_tgid = tgid;
}
rcu_read_unlock();
}