From: Xiubo Li via B4 Relay <devnull+xiubo.li.clyso.com@kernel.org>
To: Ilya Dryomov <idryomov@gmail.com>,
Alex Markuze <amarkuze@redhat.com>,
Viacheslav Dubeyko <slava@dubeyko.com>,
Milind Changire <mchangir@redhat.com>,
Jeff Layton <jlayton@kernel.org>
Cc: ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org,
Dan van der Ster <dan.vanderster@clyso.com>,
Xiubo Li <xiubo.li@clyso.com>
Subject: [PATCH 1/3] ceph: report the requested length in the netfs read metrics
Date: Wed, 14 Oct 2026 01:20:40 +0200 [thread overview]
Message-ID: <20261014-ceph-metrics-percpu-v1-1-38c5a24fec6e@clyso.com> (raw)
In-Reply-To: <20261014-ceph-metrics-percpu-v1-0-38c5a24fec6e@clyso.com>
From: Xiubo Li <xiubo.li@clyso.com>
finish_netfs_read() passes osd_data->length to
ceph_update_read_metrics(), but a buffered read of an unencrypted
file attaches its data as CEPH_OSD_DATA_TYPE_ITER, and
ceph_osd_iter_init() only sets the type and the iov_iter. length
shares a union with the iov_iter, so the read size metrics record
some unrelated iov_iter field, which is normally 0, for every page
cache read, and metrics/size is useless for buffered reads.
Report op->extent.length, the length the OSD read asked for, which is
set for every data type and equals osd_data->length for the page
vector that encrypted files still use.
Fixes: 4de77f25fd85 ("ceph: use osd_req_op_extent_osd_iter for netfs reads")
Reported-by: Dan van der Ster <dan.vanderster@clyso.com>
Signed-off-by: Xiubo Li <xiubo.li@clyso.com>
---
fs/ceph/addr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index dd2bd8ed2424..8500d72702d6 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -236,7 +236,7 @@ static void finish_netfs_read(struct ceph_osd_request *req)
ceph_blog_enter_gfp(fsc, &__ji, GFP_ATOMIC);
ceph_update_read_metrics(&fsc->mdsc->metric, req->r_start_latency,
- req->r_end_latency, osd_data->length, err);
+ req->r_end_latency, op->extent.length, err);
boutc(cl, "result %d subreq->len=%zu i_size=%lld\n", req->r_result,
subreq->len, i_size_read(req->r_inode));
--
2.53.0
next prev parent reply other threads:[~2026-10-13 23:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 23:20 [PATCH 0/3] ceph: fix the buffered read size metric and make the subvolume metrics per CPU Xiubo Li via B4 Relay
2026-10-13 23:20 ` Xiubo Li via B4 Relay [this message]
2026-10-13 23:20 ` [PATCH 2/3] ceph: drop the unused subvolume metrics debug counters Xiubo Li via B4 Relay
2026-10-13 23:20 ` [PATCH 3/3] ceph: accumulate subvolume metrics per CPU Xiubo Li via B4 Relay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261014-ceph-metrics-percpu-v1-1-38c5a24fec6e@clyso.com \
--to=devnull+xiubo.li.clyso.com@kernel.org \
--cc=amarkuze@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=dan.vanderster@clyso.com \
--cc=idryomov@gmail.com \
--cc=jlayton@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchangir@redhat.com \
--cc=slava@dubeyko.com \
--cc=xiubo.li@clyso.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®