mm/page_owner: preserve original free_pid/free_tgid during folio migration
Subsystems (2)
PATCH 1/1 mm/page_owner: preserve original free_pid/free_tgid during folio migration
From: Hongfu Li <[email protected]>
__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.
--- mm/page_owner.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
mm/page_owner.c +2 -2
@@ -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 (); }
Signature · 1 line
2.54.0
Quoted 5 lines · Hongfu Li
From: Hongfu Li <[email protected]>
__update_page_owner_free_handle()accepts pid and tgid, but ignores them, always storingcurrent->pidandcurrent->tgid.
Quoted 7 lines
__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.
Signed-off-by Hongfu Li <[email protected]>
(not critical enough stable@ imho)
Thanks!
Quoted 19 lines
--- mm/page_owner.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)mm/page_owner.c +2
-2@@ -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 (); }