diff options
author | Xiubo Li <xiubli@redhat.com> | 2020-03-20 04:45:00 +0100 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2020-06-01 13:22:51 +0200 |
commit | 1af16d547f3080d71060092d22e79a34527d1d08 (patch) | |
tree | 9ca39fde992e9f04a70c9ed25dd6cbbac9e7debd /fs/ceph/metric.h | |
parent | ceph: add dentry lease metric support (diff) | |
download | linux-1af16d547f3080d71060092d22e79a34527d1d08.tar.xz linux-1af16d547f3080d71060092d22e79a34527d1d08.zip |
ceph: add caps perf metric for each superblock
Count hits and misses in the caps cache. If the client has all of
the necessary caps when a task needs references, then it's counted
as a hit. Any other situation is a miss.
URL: https://tracker.ceph.com/issues/43215
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/metric.h')
-rw-r--r-- | fs/ceph/metric.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/ceph/metric.h b/fs/ceph/metric.h index da725dacabfe..098ee8a9adaf 100644 --- a/fs/ceph/metric.h +++ b/fs/ceph/metric.h @@ -10,8 +10,21 @@ struct ceph_client_metric { atomic64_t total_dentries; struct percpu_counter d_lease_hit; struct percpu_counter d_lease_mis; + + struct percpu_counter i_caps_hit; + struct percpu_counter i_caps_mis; }; extern int ceph_metric_init(struct ceph_client_metric *m); extern void ceph_metric_destroy(struct ceph_client_metric *m); + +static inline void ceph_update_cap_hit(struct ceph_client_metric *m) +{ + percpu_counter_inc(&m->i_caps_hit); +} + +static inline void ceph_update_cap_mis(struct ceph_client_metric *m) +{ + percpu_counter_inc(&m->i_caps_mis); +} #endif /* _FS_CEPH_MDS_METRIC_H */ |