]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
ceph: add subvolume metrics collection and reporting for-linus ceph-for-7.1-rc1
authorAlex Markuze <amarkuze@redhat.com>
Tue, 10 Feb 2026 09:06:26 +0000 (09:06 +0000)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 21 Apr 2026 23:40:23 +0000 (01:40 +0200)
commitb1137e0b3d4bad1cad73fa9bac763c74ddd1813d
treee5a764f39b6637f51af929c11612d397d9f8951f
parent4a1c5434792df72c4df6225fb697494a2405a137
ceph: add subvolume metrics collection and reporting

Add complete infrastructure for per-subvolume I/O metrics collection
and reporting to the MDS. This enables administrators to monitor I/O
patterns at the subvolume granularity, which is useful for multi-tenant
CephFS deployments.

This patch adds:
- CEPHFS_FEATURE_SUBVOLUME_METRICS feature flag for MDS negotiation
- CEPH_SUBVOLUME_ID_NONE constant (0) for unknown/unset state
- Red-black tree based metrics tracker for efficient per-subvolume
  aggregation with kmem_cache for entry allocations
- Wire format encoding matching the MDS C++ AggregatedIOMetrics struct
- Integration with the existing CLIENT_METRICS message
- Recording of I/O operations from file read/write and writeback paths
- Debugfs interfaces for monitoring (metrics/subvolumes, metrics/metric_features)

Metrics tracked per subvolume include:
- Read/write operation counts
- Read/write byte counts
- Read/write latency sums (for average calculation)

The metrics are periodically sent to the MDS as part of the existing
metrics reporting infrastructure when the MDS advertises support for
the SUBVOLUME_METRICS feature.

CEPH_SUBVOLUME_ID_NONE enforces subvolume_id immutability. Following
the FUSE client convention, 0 means unknown/unset. Once an inode has
a valid (non-zero) subvolume_id, it should not change during the
inode's lifetime.

Signed-off-by: Alex Markuze <amarkuze@redhat.com>
Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
12 files changed:
fs/ceph/Makefile
fs/ceph/addr.c
fs/ceph/debugfs.c
fs/ceph/file.c
fs/ceph/mds_client.c
fs/ceph/mds_client.h
fs/ceph/metric.c
fs/ceph/metric.h
fs/ceph/subvolume_metrics.c [new file with mode: 0644]
fs/ceph/subvolume_metrics.h [new file with mode: 0644]
fs/ceph/super.c
fs/ceph/super.h