mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] erofs: add folio order to trace_erofs_read_folio
@ 2026-06-17  7:16 Zhan Xusheng
  2026-06-17  7:25 ` Gao Xiang
  0 siblings, 1 reply; 4+ messages in thread
From: Zhan Xusheng @ 2026-06-17  7:16 UTC (permalink / raw)
  To: Gao Xiang; +Cc: Chao Yu, linux-kernel, Zhan Xusheng

erofs supports large folios for reads, but the actual folio order
instantiated in the page cache may be lower due to allocation
constraints such as memory fragmentation.

trace_erofs_read_folio already receives the folio being read but
currently records only its index. Add folio_order() to the tracepoint
so that users can observe the realized folio order and verify the
effectiveness of large folio reads.

Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
---
 include/trace/events/erofs.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/trace/events/erofs.h b/include/trace/events/erofs.h
index cd0e3fd8c23f..73d3bfd8b673 100644
--- a/include/trace/events/erofs.h
+++ b/include/trace/events/erofs.h
@@ -90,6 +90,7 @@ TRACE_EVENT(erofs_read_folio,
 		__field(erofs_nid_t,    nid     )
 		__field(int,		dir	)
 		__field(pgoff_t,	index	)
+		__field(unsigned int,	order	)
 		__field(int,		uptodate)
 		__field(bool,		raw	)
 	),
@@ -99,15 +100,17 @@ TRACE_EVENT(erofs_read_folio,
 		__entry->nid	= EROFS_I(inode)->nid;
 		__entry->dir	= S_ISDIR(inode->i_mode);
 		__entry->index	= folio->index;
+		__entry->order	= folio_order(folio);
 		__entry->uptodate = folio_test_uptodate(folio);
 		__entry->raw = raw;
 	),
 
-	TP_printk("dev = (%d,%d), nid = %llu, %s, index = %lu, uptodate = %d "
-		"raw = %d",
+	TP_printk("dev = (%d,%d), nid = %llu, %s, index = %lu, order = %u, "
+		"uptodate = %d raw = %d",
 		show_dev_nid(__entry),
 		show_file_type(__entry->dir),
 		(unsigned long)__entry->index,
+		__entry->order,
 		__entry->uptodate,
 		__entry->raw)
 );
-- 
2.43.0


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

* Re: [PATCH] erofs: add folio order to trace_erofs_read_folio
  2026-06-17  7:16 [PATCH] erofs: add folio order to trace_erofs_read_folio Zhan Xusheng
@ 2026-06-17  7:25 ` Gao Xiang
  2026-06-17  7:43   ` [PATCH v2] " Zhan Xusheng
  0 siblings, 1 reply; 4+ messages in thread
From: Gao Xiang @ 2026-06-17  7:25 UTC (permalink / raw)
  To: Zhan Xusheng, Gao Xiang; +Cc: Chao Yu, linux-kernel, Zhan Xusheng

Hi Xusheng,

On 2026/6/17 15:16, Zhan Xusheng wrote:
> erofs supports large folios for reads, but the actual folio order
> instantiated in the page cache may be lower due to allocation
> constraints such as memory fragmentation.
> 
> trace_erofs_read_folio already receives the folio being read but
> currently records only its index. Add folio_order() to the tracepoint
> so that users can observe the realized folio order and verify the
> effectiveness of large folio reads.
> 
> Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
> ---
>   include/trace/events/erofs.h | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/include/trace/events/erofs.h b/include/trace/events/erofs.h
> index cd0e3fd8c23f..73d3bfd8b673 100644
> --- a/include/trace/events/erofs.h
> +++ b/include/trace/events/erofs.h
> @@ -90,6 +90,7 @@ TRACE_EVENT(erofs_read_folio,
>   		__field(erofs_nid_t,    nid     )
>   		__field(int,		dir	)
>   		__field(pgoff_t,	index	)
> +		__field(unsigned int,	order	)
>   		__field(int,		uptodate)
>   		__field(bool,		raw	)
>   	),
> @@ -99,15 +100,17 @@ TRACE_EVENT(erofs_read_folio,
>   		__entry->nid	= EROFS_I(inode)->nid;
>   		__entry->dir	= S_ISDIR(inode->i_mode);
>   		__entry->index	= folio->index;
> +		__entry->order	= folio_order(folio);
>   		__entry->uptodate = folio_test_uptodate(folio);

I guess uptodate is unneeded, it should be always !uptodate.

>   		__entry->raw = raw;
>   	),
>   
> -	TP_printk("dev = (%d,%d), nid = %llu, %s, index = %lu, uptodate = %d "
> -		"raw = %d",
> +	TP_printk("dev = (%d,%d), nid = %llu, %s, index = %lu, order = %u, "
> +		"uptodate = %d raw = %d",

Just a nit, can we rearrange the message into one line
in this patch?

i.e.
	"dev = (%d,%d), nid = %llu, %s, index = %lu, order = %u, raw = %d",

Thanks,
Gao Xiang

>   		show_dev_nid(__entry),
>   		show_file_type(__entry->dir),
>   		(unsigned long)__entry->index,
> +		__entry->order,
>   		__entry->uptodate,
>   		__entry->raw)
>   );


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

* [PATCH v2] erofs: add folio order to trace_erofs_read_folio
  2026-06-17  7:25 ` Gao Xiang
@ 2026-06-17  7:43   ` Zhan Xusheng
  2026-06-18  8:12     ` Gao Xiang
  0 siblings, 1 reply; 4+ messages in thread
From: Zhan Xusheng @ 2026-06-17  7:43 UTC (permalink / raw)
  To: Gao Xiang; +Cc: Chao Yu, linux-kernel, Zhan Xusheng

erofs supports large folios for reads, but the actual folio order
instantiated in the page cache may be lower due to allocation
constraints such as memory fragmentation.

trace_erofs_read_folio already receives the folio being read but
currently records only its index. Add folio_order() to the tracepoint
so that users can observe the realized folio order and verify the
effectiveness of large folio reads.

Also drop the uptodate field: read_folio() is only called for a
non-uptodate folio, so it is always 0.

Suggested-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
---
 include/trace/events/erofs.h | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/include/trace/events/erofs.h b/include/trace/events/erofs.h
index cd0e3fd8c23f..0a178cb10fb1 100644
--- a/include/trace/events/erofs.h
+++ b/include/trace/events/erofs.h
@@ -90,7 +90,7 @@ TRACE_EVENT(erofs_read_folio,
 		__field(erofs_nid_t,    nid     )
 		__field(int,		dir	)
 		__field(pgoff_t,	index	)
-		__field(int,		uptodate)
+		__field(unsigned int,	order	)
 		__field(bool,		raw	)
 	),
 
@@ -99,16 +99,15 @@ TRACE_EVENT(erofs_read_folio,
 		__entry->nid	= EROFS_I(inode)->nid;
 		__entry->dir	= S_ISDIR(inode->i_mode);
 		__entry->index	= folio->index;
-		__entry->uptodate = folio_test_uptodate(folio);
+		__entry->order	= folio_order(folio);
 		__entry->raw = raw;
 	),
 
-	TP_printk("dev = (%d,%d), nid = %llu, %s, index = %lu, uptodate = %d "
-		"raw = %d",
+	TP_printk("dev = (%d,%d), nid = %llu, %s, index = %lu, order = %u, raw = %d",
 		show_dev_nid(__entry),
 		show_file_type(__entry->dir),
 		(unsigned long)__entry->index,
-		__entry->uptodate,
+		__entry->order,
 		__entry->raw)
 );
 
-- 
2.43.0


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

* Re: [PATCH v2] erofs: add folio order to trace_erofs_read_folio
  2026-06-17  7:43   ` [PATCH v2] " Zhan Xusheng
@ 2026-06-18  8:12     ` Gao Xiang
  0 siblings, 0 replies; 4+ messages in thread
From: Gao Xiang @ 2026-06-18  8:12 UTC (permalink / raw)
  To: Zhan Xusheng
  Cc: Chao Yu, linux-kernel, Zhan Xusheng, linux-erofs mailing list



On 2026/6/17 15:43, Zhan Xusheng wrote:
> erofs supports large folios for reads, but the actual folio order
> instantiated in the page cache may be lower due to allocation
> constraints such as memory fragmentation.
> 
> trace_erofs_read_folio already receives the folio being read but
> currently records only its index. Add folio_order() to the tracepoint
> so that users can observe the realized folio order and verify the
> effectiveness of large folio reads.
> 
> Also drop the uptodate field: read_folio() is only called for a
> non-uptodate folio, so it is always 0.
> 
> Suggested-by: Gao Xiang <hsiangkao@linux.alibaba.com>
> Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>

Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>

But pls also Cc erofs mailing list <linux-erofs@lists.ozlabs.org>
next time

Thanks,
Gao Xiang

> ---
>   include/trace/events/erofs.h | 9 ++++-----
>   1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/include/trace/events/erofs.h b/include/trace/events/erofs.h
> index cd0e3fd8c23f..0a178cb10fb1 100644
> --- a/include/trace/events/erofs.h
> +++ b/include/trace/events/erofs.h
> @@ -90,7 +90,7 @@ TRACE_EVENT(erofs_read_folio,
>   		__field(erofs_nid_t,    nid     )
>   		__field(int,		dir	)
>   		__field(pgoff_t,	index	)
> -		__field(int,		uptodate)
> +		__field(unsigned int,	order	)
>   		__field(bool,		raw	)
>   	),
>   
> @@ -99,16 +99,15 @@ TRACE_EVENT(erofs_read_folio,
>   		__entry->nid	= EROFS_I(inode)->nid;
>   		__entry->dir	= S_ISDIR(inode->i_mode);
>   		__entry->index	= folio->index;
> -		__entry->uptodate = folio_test_uptodate(folio);
> +		__entry->order	= folio_order(folio);
>   		__entry->raw = raw;
>   	),
>   
> -	TP_printk("dev = (%d,%d), nid = %llu, %s, index = %lu, uptodate = %d "
> -		"raw = %d",
> +	TP_printk("dev = (%d,%d), nid = %llu, %s, index = %lu, order = %u, raw = %d",
>   		show_dev_nid(__entry),
>   		show_file_type(__entry->dir),
>   		(unsigned long)__entry->index,
> -		__entry->uptodate,
> +		__entry->order,
>   		__entry->raw)
>   );
>   


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

end of thread, other threads:[~2026-06-18  8:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-17  7:16 [PATCH] erofs: add folio order to trace_erofs_read_folio Zhan Xusheng
2026-06-17  7:25 ` Gao Xiang
2026-06-17  7:43   ` [PATCH v2] " Zhan Xusheng
2026-06-18  8:12     ` Gao Xiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome