linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/cma: add 'available count' and 'total count' to trace_cma_alloc_start
@ 2025-08-19 13:48 Xiang Gao
  2025-08-19 19:17 ` David Hildenbrand
  2025-08-20  0:31 ` Andrew Morton
  0 siblings, 2 replies; 5+ messages in thread
From: Xiang Gao @ 2025-08-19 13:48 UTC (permalink / raw)
  To: akpm, david
  Cc: lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb, mhocko,
	linux-mm, linux-kernel, gaoxiang17

From: gaoxiang17 <gaoxiang17@xiaomi.com>

This makes cma info more intuitive during debugging.

Signed-off-by: gaoxiang17 <gaoxiang17@xiaomi.com>
---
 include/trace/events/cma.h | 17 ++++++++++++-----
 mm/cma.c                   |  2 +-
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/include/trace/events/cma.h b/include/trace/events/cma.h
index 383c09f583ac..fbe70008ffc7 100644
--- a/include/trace/events/cma.h
+++ b/include/trace/events/cma.h
@@ -38,25 +38,32 @@ TRACE_EVENT(cma_release,
 
 TRACE_EVENT(cma_alloc_start,
 
-	TP_PROTO(const char *name, unsigned long count, unsigned int align),
+	TP_PROTO(const char *name, unsigned long request_count, unsigned long available_count,
+		unsigned long total_count, unsigned int align),
 
-	TP_ARGS(name, count, align),
+	TP_ARGS(name, request_count, available_count, total_count, align),
 
 	TP_STRUCT__entry(
 		__string(name, name)
-		__field(unsigned long, count)
+		__field(unsigned long, request_count)
+		__field(unsigned long, available_count)
+		__field(unsigned long, total_count)
 		__field(unsigned int, align)
 	),
 
 	TP_fast_assign(
 		__assign_str(name);
-		__entry->count = count;
+		__entry->count = request_count;
+		__entry->available_count = available_count;
+		__entry->total_count = total_count;
 		__entry->align = align;
 	),
 
 	TP_printk("name=%s count=%lu align=%u",
 		  __get_str(name),
-		  __entry->count,
+		  __entry->request_count,
+		  __entry->available_count,
+		  __entry->total_count,
 		  __entry->align)
 );
 
diff --git a/mm/cma.c b/mm/cma.c
index 2ffa4befb99a..e56ec64d0567 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -864,7 +864,7 @@ static struct page *__cma_alloc(struct cma *cma, unsigned long count,
 	if (!count)
 		return page;
 
-	trace_cma_alloc_start(name, count, align);
+	trace_cma_alloc_start(name, count, cma->available_count, cma->count, align);
 
 	for (r = 0; r < cma->nranges; r++) {
 		page = NULL;
-- 
2.34.1



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

* Re: [PATCH] mm/cma: add 'available count' and 'total count' to trace_cma_alloc_start
  2025-08-19 13:48 [PATCH] mm/cma: add 'available count' and 'total count' to trace_cma_alloc_start Xiang Gao
@ 2025-08-19 19:17 ` David Hildenbrand
  2025-08-20  1:55   ` 答复: [External Mail]Re: " 高翔
  2025-08-20  0:31 ` Andrew Morton
  1 sibling, 1 reply; 5+ messages in thread
From: David Hildenbrand @ 2025-08-19 19:17 UTC (permalink / raw)
  To: Xiang Gao, akpm
  Cc: lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb, mhocko,
	linux-mm, linux-kernel, gaoxiang17

On 19.08.25 15:48, Xiang Gao wrote:
> From: gaoxiang17 <gaoxiang17@xiaomi.com>
> 
> This makes cma info more intuitive during debugging.
> 
> Signed-off-by: gaoxiang17 <gaoxiang17@xiaomi.com>
> ---

For the next time: you should have indicated that this is v2 ([PATCH 
v2]) and briefly described under the "---" the changes between v1 and v2.

Acked-by: David Hildenbrand <david@redhat.com>

-- 
Cheers

David / dhildenb



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

* Re: [PATCH] mm/cma: add 'available count' and 'total count' to trace_cma_alloc_start
  2025-08-19 13:48 [PATCH] mm/cma: add 'available count' and 'total count' to trace_cma_alloc_start Xiang Gao
  2025-08-19 19:17 ` David Hildenbrand
@ 2025-08-20  0:31 ` Andrew Morton
  2025-08-20  1:55   ` 答复: [External Mail]Re: " 高翔
  1 sibling, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2025-08-20  0:31 UTC (permalink / raw)
  To: Xiang Gao
  Cc: david, lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb,
	mhocko, linux-mm, linux-kernel, gaoxiang17

On Tue, 19 Aug 2025 21:48:17 +0800 Xiang Gao <gxxa03070307@gmail.com> wrote:

> From: gaoxiang17 <gaoxiang17@xiaomi.com>
> 
> This makes cma info more intuitive during debugging.
> 
> ...
>
> --- a/include/trace/events/cma.h
> +++ b/include/trace/events/cma.h
>
> ...
>
>  	TP_STRUCT__entry(
>  		__string(name, name)
> -		__field(unsigned long, count)
> +		__field(unsigned long, request_count)
> +		__field(unsigned long, available_count)
> +		__field(unsigned long, total_count)
>  		__field(unsigned int, align)
>  	),
>  
>  	TP_fast_assign(
>  		__assign_str(name);
> -		__entry->count = count;
> +		__entry->count = request_count;
> +		__entry->available_count = available_count;
> +		__entry->total_count = total_count;
>  		__entry->align = align;
>  	),
>  
>  	TP_printk("name=%s count=%lu align=%u",
>  		  __get_str(name),
> -		  __entry->count,
> +		  __entry->request_count,
> +		  __entry->available_count,
> +		  __entry->total_count,
>  		  __entry->align)

adds three args to the printk but didn't add their conversions to the
printk control string?




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

* 答复: [External Mail]Re: [PATCH] mm/cma: add 'available count' and 'total count' to trace_cma_alloc_start
  2025-08-19 19:17 ` David Hildenbrand
@ 2025-08-20  1:55   ` 高翔
  0 siblings, 0 replies; 5+ messages in thread
From: 高翔 @ 2025-08-20  1:55 UTC (permalink / raw)
  To: David Hildenbrand, Xiang Gao, akpm@linux-foundation.org
  Cc: lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com,
	vbabka@suse.cz, rppt@kernel.org, surenb@google.com,
	mhocko@suse.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 1015 bytes --]


ok, thinks

________________________________
发件人: David Hildenbrand <david@redhat.com>
发送时间: 2025年8月20日 3:17:06
收件人: Xiang Gao; akpm@linux-foundation.org
抄送: lorenzo.stoakes@oracle.com; Liam.Howlett@oracle.com; vbabka@suse.cz; rppt@kernel.org; surenb@google.com; mhocko@suse.com; linux-mm@kvack.org; linux-kernel@vger.kernel.org; 高翔
主题: [External Mail]Re: [PATCH] mm/cma: add 'available count' and 'total count' to trace_cma_alloc_start

[外部邮件] 此邮件来源于小米公司外部,请谨慎处理。若对邮件安全性存疑,请将邮件转发给misec@xiaomi.com进行反馈

On 19.08.25 15:48, Xiang Gao wrote:
> From: gaoxiang17 <gaoxiang17@xiaomi.com>
>
> This makes cma info more intuitive during debugging.
>
> Signed-off-by: gaoxiang17 <gaoxiang17@xiaomi.com>
> ---

For the next time: you should have indicated that this is v2 ([PATCH
v2]) and briefly described under the "---" the changes between v1 and v2.

Acked-by: David Hildenbrand <david@redhat.com>

--
Cheers

David / dhildenb


[-- Attachment #2: Type: text/html, Size: 2199 bytes --]

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

* 答复: [External Mail]Re: [PATCH] mm/cma: add 'available count' and 'total count' to trace_cma_alloc_start
  2025-08-20  0:31 ` Andrew Morton
@ 2025-08-20  1:55   ` 高翔
  0 siblings, 0 replies; 5+ messages in thread
From: 高翔 @ 2025-08-20  1:55 UTC (permalink / raw)
  To: Andrew Morton, Xiang Gao
  Cc: david@redhat.com, lorenzo.stoakes@oracle.com,
	Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org,
	surenb@google.com, mhocko@suse.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 1914 bytes --]


Sorry, I've changed it.

________________________________
发件人: Andrew Morton <akpm@linux-foundation.org>
发送时间: 2025年8月20日 8:31:15
收件人: Xiang Gao
抄送: david@redhat.com; lorenzo.stoakes@oracle.com; Liam.Howlett@oracle.com; vbabka@suse.cz; rppt@kernel.org; surenb@google.com; mhocko@suse.com; linux-mm@kvack.org; linux-kernel@vger.kernel.org; 高翔
主题: [External Mail]Re: [PATCH] mm/cma: add 'available count' and 'total count' to trace_cma_alloc_start

[外部邮件] 此邮件来源于小米公司外部,请谨慎处理。若对邮件安全性存疑,请将邮件转发给misec@xiaomi.com进行反馈

On Tue, 19 Aug 2025 21:48:17 +0800 Xiang Gao <gxxa03070307@gmail.com> wrote:

> From: gaoxiang17 <gaoxiang17@xiaomi.com>
>
> This makes cma info more intuitive during debugging.
>
> ...
>
> --- a/include/trace/events/cma.h
> +++ b/include/trace/events/cma.h
>
> ...
>
>       TP_STRUCT__entry(
>               __string(name, name)
> -             __field(unsigned long, count)
> +             __field(unsigned long, request_count)
> +             __field(unsigned long, available_count)
> +             __field(unsigned long, total_count)
>               __field(unsigned int, align)
>       ),
>
>       TP_fast_assign(
>               __assign_str(name);
> -             __entry->count = count;
> +             __entry->count = request_count;
> +             __entry->available_count = available_count;
> +             __entry->total_count = total_count;
>               __entry->align = align;
>       ),
>
>       TP_printk("name=%s count=%lu align=%u",
>                 __get_str(name),
> -               __entry->count,
> +               __entry->request_count,
> +               __entry->available_count,
> +               __entry->total_count,
>                 __entry->align)

adds three args to the printk but didn't add their conversions to the
printk control string?



[-- Attachment #2: Type: text/html, Size: 4742 bytes --]

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

end of thread, other threads:[~2025-08-20  1:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-19 13:48 [PATCH] mm/cma: add 'available count' and 'total count' to trace_cma_alloc_start Xiang Gao
2025-08-19 19:17 ` David Hildenbrand
2025-08-20  1:55   ` 答复: [External Mail]Re: " 高翔
2025-08-20  0:31 ` Andrew Morton
2025-08-20  1:55   ` 答复: [External Mail]Re: " 高翔

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).