From: Hyeonggon Yoo 42.hyeyoo@gmail.com
mainline inclusion from mainline-v6.3-rc1 commit 05a421995503b746095d8ac93fa0ddadfc3c81bc category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9GSSR
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
--------------------------------
When allocating a high-order page, separate allocation timestamp is recorded for each sub-page resulting in different timestamp values between them.
This behavior is not consistent with the behavior when recording free timestamp and caused confusion when analyzing memory dumps. Record single timestamp for the entire allocation, aligning with the behavior for free timestamps.
Link: https://lkml.kernel.org/r/20230121165054.520507-1-42.hyeyoo@gmail.com Signed-off-by: Hyeonggon Yoo 42.hyeyoo@gmail.com Cc: David Hildenbrand david@redhat.com Cc: David Rientjes rientjes@google.com Cc: Joonsoo Kim iamjoonsoo.kim@lge.com Cc: Michal Hocko mhocko@kernel.org Cc: Mike Rapoport rppt@linux.ibm.com Cc: Vlastimil Babka vbabka@suse.cz Signed-off-by: Andrew Morton akpm@linux-foundation.org Signed-off-by: Jinjiang Tu tujinjiang@huawei.com --- mm/page_owner.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/page_owner.c b/mm/page_owner.c index ea1a1e4063b2..119f028ef559 100644 --- a/mm/page_owner.c +++ b/mm/page_owner.c @@ -166,6 +166,7 @@ static inline void __set_page_owner_handle(struct page *page, { struct page_owner *page_owner; int i; + u64 ts_nsec = local_clock();
for (i = 0; i < (1 << order); i++) { page_owner = get_page_owner(page_ext); @@ -175,7 +176,7 @@ static inline void __set_page_owner_handle(struct page *page, page_owner->last_migrate_reason = -1; page_owner->pid = current->pid; page_owner->tgid = current->tgid; - page_owner->ts_nsec = local_clock(); + page_owner->ts_nsec = ts_nsec; strscpy(page_owner->comm, current->comm, sizeof(page_owner->comm)); __set_bit(PAGE_EXT_OWNER, &page_ext->flags);