aboutsummaryrefslogtreecommitdiffstats
path: root/fs/netfs/buffered_read.c
diff options
context:
space:
mode:
authorDavid Howells <[email protected]>2024-12-16 20:40:54 +0000
committerChristian Brauner <[email protected]>2024-12-20 21:34:02 +0000
commitaabcabf2746062253565b33aa3f8d25999a5ac01 (patch)
treec6471f14ba0a7f7d44a9d0e721949db33ddd5471 /fs/netfs/buffered_read.c
parentnetfs: Use a folio_queue allocation and free functions (diff)
downloadkernel-aabcabf2746062253565b33aa3f8d25999a5ac01.tar.gz
kernel-aabcabf2746062253565b33aa3f8d25999a5ac01.zip
netfs: Add a tracepoint to log the lifespan of folio_queue structs
Add a tracepoint to log the lifespan of folio_queue structs. For tracing illustrative purposes, folio_queues are tagged with the debug ID of whatever they're related to (typically a netfs_io_request) and a debug ID of their own. Signed-off-by: David Howells <[email protected]> Link: https://lore.kernel.org/r/[email protected] cc: Jeff Layton <[email protected]> cc: [email protected] cc: [email protected] Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'fs/netfs/buffered_read.c')
-rw-r--r--fs/netfs/buffered_read.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/netfs/buffered_read.c b/fs/netfs/buffered_read.c
index 78b04763bed6..7ec04d5628d8 100644
--- a/fs/netfs/buffered_read.c
+++ b/fs/netfs/buffered_read.c
@@ -131,7 +131,8 @@ static ssize_t netfs_prepare_read_iterator(struct netfs_io_subrequest *subreq)
struct folio_queue *tail = rreq->buffer_tail, *new;
size_t added;
- new = netfs_folioq_alloc(GFP_NOFS);
+ new = netfs_folioq_alloc(rreq->debug_id, GFP_NOFS,
+ netfs_trace_folioq_alloc_read_prep);
if (!new)
return -ENOMEM;
new->prev = tail;
@@ -361,9 +362,11 @@ static int netfs_prime_buffer(struct netfs_io_request *rreq)
struct folio_batch put_batch;
size_t added;
- folioq = netfs_folioq_alloc(GFP_KERNEL);
+ folioq = netfs_folioq_alloc(rreq->debug_id, GFP_KERNEL,
+ netfs_trace_folioq_alloc_read_prime);
if (!folioq)
return -ENOMEM;
+
rreq->buffer = folioq;
rreq->buffer_tail = folioq;
rreq->submitted = rreq->start;
@@ -436,7 +439,8 @@ static int netfs_create_singular_buffer(struct netfs_io_request *rreq, struct fo
{
struct folio_queue *folioq;
- folioq = netfs_folioq_alloc(GFP_KERNEL);
+ folioq = netfs_folioq_alloc(rreq->debug_id, GFP_KERNEL,
+ netfs_trace_folioq_alloc_read_sing);
if (!folioq)
return -ENOMEM;