libceph: add osd op counter metric support
PATCH 1/1 libceph: add osd op counter metric support
From: Xiubo Li <[email protected]>
The logic is the same with osdc/Objecter.cc in ceph in user space.
URL: https://tracker.ceph.com/issues/48053
--- include/linux/ceph/osd_client.h | 46 ++++++ net/ceph/debugfs.c | 51 +++++++ net/ceph/osd_client.c | 249 +++++++++++++++++++++++++++++++- 3 files changed, 343 insertions(+), 3 deletions(-)
include/linux/ceph/osd_client.h +46 -0
@@ -339,6 +339,50 @@ struct ceph_osd_backoff {struct ceph_hobject_id *end; }; +struct ceph_osd_metric { +struct percpu_counter op_ops; +struct percpu_counter op_oplen_avg; +struct percpu_counter op_send; +struct percpu_counter op_send_bytes; +struct percpu_counter op_resend; +struct percpu_counter op_reply; + +struct percpu_counter op_rmw; +struct percpu_counter op_r; +struct percpu_counter op_w; +struct percpu_counter op_pgop; + +struct percpu_counter op_stat; +struct percpu_counter op_create; +struct percpu_counter op_read; +struct percpu_counter op_write; +struct percpu_counter op_writefull; +struct percpu_counter op_append; +struct percpu_counter op_zero; +struct percpu_counter op_truncate; +struct percpu_counter op_delete; +struct percpu_counter op_mapext; +struct percpu_counter op_sparse_read; +struct percpu_counter op_clonerange; +struct percpu_counter op_getxattr; +struct percpu_counter op_setxattr; +struct percpu_counter op_cmpxattr; +struct percpu_counter op_rmxattr; +struct percpu_counter op_resetxattrs; +struct percpu_counter op_call; +struct percpu_counter op_watch; +struct percpu_counter op_notify; + +struct percpu_counter op_omap_rd; +struct percpu_counter op_omap_wr; +struct percpu_counter op_omap_del; + +struct percpu_counter op_linger_active; +struct percpu_counter op_linger_send; +struct percpu_counter op_linger_resend; +struct percpu_counter op_linger_ping; +}; +#define CEPH_LINGER_ID_START 0xffff000000000000ULLstruct ceph_osd_client {
@@ -371,6 +415,8 @@ struct ceph_osd_client {struct ceph_msgpool msgpool_op;struct ceph_msgpool msgpool_op_reply; +struct ceph_osd_metric metric; +struct workqueue_struct *notify_wq;struct workqueue_struct *completion_wq; };
net/ceph/debugfs.c +51 -0
63 lines not on this page · raw message
net/ceph/osd_client.c +246 -3
348 lines not on this page · raw message
Signature · 1 line
2.27.0
Ilya Dryomov
maintainerQuoted 53 lines · On Tue, Nov 10, 2020 at 3:01 AM <[email protected]> wrote:
From: Xiubo Li <[email protected]>
The logic is the same with osdc/Objecter.cc in ceph in user space.
URL: https://tracker.ceph.com/issues/48053
Signed-off-by Xiubo Li <[email protected]>--- include/linux/ceph/osd_client.h | 46 ++++++ net/ceph/debugfs.c | 51 +++++++ net/ceph/osd_client.c | 249 +++++++++++++++++++++++++++++++- 3 files changed, 343 insertions(+), 3 deletions(-)include/linux/ceph/osd_client.h +32
-0@@ -339,6 +339,50 @@ struct ceph_osd_backoff {struct ceph_hobject_id *end; }; +struct ceph_osd_metric { +struct percpu_counter op_ops; +struct percpu_counter op_oplen_avg; +struct percpu_counter op_send; +struct percpu_counter op_send_bytes; +struct percpu_counter op_resend; +struct percpu_counter op_reply; + +struct percpu_counter op_rmw; +struct percpu_counter op_r; +struct percpu_counter op_w; +struct percpu_counter op_pgop; + +struct percpu_counter op_stat; +struct percpu_counter op_create; +struct percpu_counter op_read; +struct percpu_counter op_write; +struct percpu_counter op_writefull; +struct percpu_counter op_append; +struct percpu_counter op_zero; +struct percpu_counter op_truncate; +struct percpu_counter op_delete; +struct percpu_counter op_mapext; +struct percpu_counter op_sparse_read; +struct percpu_counter op_clonerange; +struct percpu_counter op_getxattr; +struct percpu_counter op_setxattr; +struct percpu_counter op_cmpxattr; +struct percpu_counter op_rmxattr; +struct percpu_counter op_resetxattrs; +struct percpu_counter op_call; +struct percpu_counter op_watch;
include/linux/ceph/osd_client.h struct ceph_osd_backoff { · line 383
Quoted 10 lines
include/linux/ceph/osd_client.h +10
-0+struct percpu_counter op_notify; + +struct percpu_counter op_omap_rd; +struct percpu_counter op_omap_wr; +struct percpu_counter op_omap_del; + +struct percpu_counter op_linger_active; +struct percpu_counter op_linger_send; +struct percpu_counter op_linger_resend; +struct percpu_counter op_linger_ping;
Many of these ops aren't supported by the kernel client. Let's trim this down to what your use case actually needs. If it's just reads and writes, aren't they already surfaced through the new filesystem metrics framework?
Thanks,
Ilya
Quoted 57 lines · Ilya Dryomov
Quoted 56 lines · On Tue, Nov 10, 2020 at 3:01 AM <[email protected]> wrote:
From: Xiubo Li <[email protected]>
The logic is the same with osdc/Objecter.cc in ceph in user space.
URL: https://tracker.ceph.com/issues/48053
Signed-off-by Xiubo Li <[email protected]>--- include/linux/ceph/osd_client.h | 46 ++++++ net/ceph/debugfs.c | 51 +++++++ net/ceph/osd_client.c | 249 +++++++++++++++++++++++++++++++- 3 files changed, 343 insertions(+), 3 deletions(-)include/linux/ceph/osd_client.h +36
-0@@ -339,6 +339,50 @@ struct ceph_osd_backoff {struct ceph_hobject_id *end; }; +struct ceph_osd_metric { +struct percpu_counter op_ops; +struct percpu_counter op_oplen_avg; +struct percpu_counter op_send; +struct percpu_counter op_send_bytes; +struct percpu_counter op_resend; +struct percpu_counter op_reply; + +struct percpu_counter op_rmw; +struct percpu_counter op_r; +struct percpu_counter op_w; +struct percpu_counter op_pgop; + +struct percpu_counter op_stat; +struct percpu_counter op_create; +struct percpu_counter op_read; +struct percpu_counter op_write; +struct percpu_counter op_writefull; +struct percpu_counter op_append; +struct percpu_counter op_zero; +struct percpu_counter op_truncate; +struct percpu_counter op_delete; +struct percpu_counter op_mapext; +struct percpu_counter op_sparse_read; +struct percpu_counter op_clonerange; +struct percpu_counter op_getxattr; +struct percpu_counter op_setxattr; +struct percpu_counter op_cmpxattr; +struct percpu_counter op_rmxattr; +struct percpu_counter op_resetxattrs; +struct percpu_counter op_call; +struct percpu_counter op_watch; +struct percpu_counter op_notify; + +struct percpu_counter op_omap_rd; +struct percpu_counter op_omap_wr;
Quoted 8 lines
include/linux/ceph/osd_client.h struct ceph_osd_backoff { · line 383
Quoted 6 lines
include/linux/ceph/osd_client.h +6
-0+struct percpu_counter op_omap_del; + +struct percpu_counter op_linger_active; +struct percpu_counter op_linger_send; +struct percpu_counter op_linger_resend; +struct percpu_counter op_linger_ping;Many of these ops aren't supported by the kernel client. Let's trim this down to what your use case actually needs.
Sure.
Quoted 3 lines
If it's just reads and
writes, aren't they already surfaced through the new filesystem metrics framework?
That framework only includes the read/write latency related metrics, but for the test_readahead and some other qa test cases that metrics make no sense.
Thanks
BRs
Quoted 4 lines
Thanks,
Ilya