On Thu, 2020-07-16 at 10:05 -0400, xiubli@xxxxxxxxxx wrote: > From: Xiubo Li <xiubli@xxxxxxxxxx> > > This will send the caps/read/write/metadata metrics to any available > MDS only once per second as default, which will be the same as the > userland client. It will skip the MDS sessions which don't support > the metric collection, or the MDSs will close the socket connections > directly when it get an unknown type message. > > We can disable the metric sending via the disable_send_metric module > parameter. > > URL: https://tracker.ceph.com/issues/43215 > Signed-off-by: Xiubo Li <xiubli@xxxxxxxxxx> > --- > fs/ceph/mds_client.c | 4 + > fs/ceph/mds_client.h | 4 +- > fs/ceph/metric.c | 151 +++++++++++++++++++++++++++++++++++ > fs/ceph/metric.h | 77 ++++++++++++++++++ > fs/ceph/super.c | 42 ++++++++++ > fs/ceph/super.h | 2 + > include/linux/ceph/ceph_fs.h | 1 + > 7 files changed, 280 insertions(+), 1 deletion(-) > > diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c > index 9a09d12569bd..cf4c2ba2311f 100644 > --- a/fs/ceph/mds_client.c > +++ b/fs/ceph/mds_client.c > @@ -3334,6 +3334,8 @@ static void handle_session(struct ceph_mds_session *session, > session->s_state = CEPH_MDS_SESSION_OPEN; > session->s_features = features; > renewed_caps(mdsc, session, 0); > + if (test_bit(CEPHFS_FEATURE_METRIC_COLLECT, &session->s_features)) > + metric_schedule_delayed(&mdsc->metric); > wake = 1; > if (mdsc->stopping) > __close_session(mdsc, session); > @@ -4303,6 +4305,7 @@ bool check_session_state(struct ceph_mds_session *s) > } > if (s->s_state == CEPH_MDS_SESSION_NEW || > s->s_state == CEPH_MDS_SESSION_RESTARTING || > + s->s_state == CEPH_MDS_SESSION_CLOSED || ^^^ Is this an independent bugfix that should be a standalone patch? -- Jeff Layton <jlayton@xxxxxxxxxx>