mm/page_owner.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
From: Hongfu Li <lihongfu@kylinos.cn>
__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.
Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
---
mm/page_owner.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/page_owner.c b/mm/page_owner.c
index 3fc37d9b908e..cfc31c92d765 100644
--- a/mm/page_owner.c
+++ b/mm/page_owner.c
@@ -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();
}
--
2.54.0
On 9/3/26 11:21, Hongfu Li wrote:
> From: Hongfu Li <lihongfu@kylinos.cn>
>
> __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.
>
> Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
Fixes: ea4b5b33bf8a ("mm,page_owner: update metadata for tail pages")
(not critical enough stable@ imho)
Acked-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Thanks!
> ---
> mm/page_owner.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/page_owner.c b/mm/page_owner.c
> index 3fc37d9b908e..cfc31c92d765 100644
> --- a/mm/page_owner.c
> +++ b/mm/page_owner.c
> @@ -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();
> }
© 2016 - 2026 Red Hat, Inc.