[PATCH 0/3] ceph: fix the buffered read size metric and make the subvolume metrics per CPU

From: Xiubo Li via B4 Relay

Date: Tue Oct 13 2026 - 19:21:04 EST


Two problems in the client I/O metrics, reported by Dan van der Ster
while looking at IO500 runs on 144-core Grace clients.

Patch 1: metrics/size has reported 0 bytes for every page cache read
since buffered reads moved to CEPH_OSD_DATA_TYPE_ITER, because
finish_netfs_read() still reads osd_data->length, which only the page
vector type sets.

Patches 2-3: every OSD read and write completion updates the subvolume
metrics through state shared by the whole mount. Even with subvolume
metrics disabled it bumped an atomic64 counter that nothing reads;
with them enabled it took a mount-wide spinlock and searched an rbtree.
Patch 2 drops the unused counters, patch 3 accumulates the counters in
a per-CPU slot and only folds them into the tree when the slot changes
subvolume or when the metrics are sent or dumped.

Tested on x86_64 against a main MDS with SUBVOLUME_METRICS: 16 jobs on
16 CPUs writing and reading two subvolumes and a plain directory. The
read sizes are now reported, and the per-subvolume op and byte totals
summed over every metrics send match the I/O issued.

---
Xiubo Li (3):
ceph: report the requested length in the netfs read metrics
ceph: drop the unused subvolume metrics debug counters
ceph: accumulate subvolume metrics per CPU

fs/ceph/addr.c | 2 +-
fs/ceph/mds_client.c | 6 +-
fs/ceph/subvolume_metrics.c | 172 +++++++++++++++++++++++++++++++-------------
fs/ceph/subvolume_metrics.h | 26 ++-----
4 files changed, 133 insertions(+), 73 deletions(-)
---
base-commit: ed0502cb11f84fff29f374238e526ae94d9bdfde
change-id: 20261014-ceph-metrics-percpu-1cb5047f7150

Best regards,
--
Xiubo Li <xiubo.li@xxxxxxxxx>