linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH mm-unstable] mm/page_owner: record single timestamp value for high order allocations
@ 2023-01-21 16:50 Hyeonggon Yoo
  2023-02-08 17:02 ` Vlastimil Babka
  0 siblings, 1 reply; 2+ messages in thread
From: Hyeonggon Yoo @ 2023-01-21 16:50 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Mike Rapoport, David Rientjes, Joonsoo Kim, Vlastimil Babka,
	Michal Hocko, David Hildenbrand, Hyeonggon Yoo, linux-mm,
	linux-kernel

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.

Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.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 f0553bedb39d..80dc8f4050fa 100644
--- a/mm/page_owner.c
+++ b/mm/page_owner.c
@@ -163,6 +163,7 @@ static inline void __set_page_owner_handle(struct page_ext *page_ext,
 {
 	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);
@@ -172,7 +173,7 @@ static inline void __set_page_owner_handle(struct page_ext *page_ext,
 		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);
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH mm-unstable] mm/page_owner: record single timestamp value for high order allocations
  2023-01-21 16:50 [PATCH mm-unstable] mm/page_owner: record single timestamp value for high order allocations Hyeonggon Yoo
@ 2023-02-08 17:02 ` Vlastimil Babka
  0 siblings, 0 replies; 2+ messages in thread
From: Vlastimil Babka @ 2023-02-08 17:02 UTC (permalink / raw)
  To: Hyeonggon Yoo, Andrew Morton
  Cc: Mike Rapoport, David Rientjes, Joonsoo Kim, Michal Hocko,
	David Hildenbrand, linux-mm, linux-kernel

On 1/21/23 17:50, Hyeonggon Yoo wrote:
> 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.
> 
> Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>  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 f0553bedb39d..80dc8f4050fa 100644
> --- a/mm/page_owner.c
> +++ b/mm/page_owner.c
> @@ -163,6 +163,7 @@ static inline void __set_page_owner_handle(struct page_ext *page_ext,
>  {
>  	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);
> @@ -172,7 +173,7 @@ static inline void __set_page_owner_handle(struct page_ext *page_ext,
>  		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);



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-08 17:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-21 16:50 [PATCH mm-unstable] mm/page_owner: record single timestamp value for high order allocations Hyeonggon Yoo
2023-02-08 17:02 ` Vlastimil Babka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).