From: Xiubo Li <xiubli@redhat.com>
To: Ilya Dryomov <idryomov@gmail.com>, Jeff Layton <jlayton@kernel.org>
Cc: Sage Weil <sage@redhat.com>, "Yan, Zheng" <zyan@redhat.com>,
Patrick Donnelly <pdonnell@redhat.com>,
Ceph Development <ceph-devel@vger.kernel.org>
Subject: Re: [PATCH v8 5/5] ceph: add global metadata perf metric support
Date: Sat, 22 Feb 2020 09:20:51 +0800 [thread overview]
Message-ID: <8d977d6a-da80-5900-aead-395b9b4eaa76@redhat.com> (raw)
In-Reply-To: <CAOi1vP92XUaOfQ_xJFZDXuH4r9D07fW6ckEyd2csr7EhUSRkpg@mail.gmail.com>
On 2020/2/21 22:56, Ilya Dryomov wrote:
> On Fri, Feb 21, 2020 at 1:03 PM Jeff Layton <jlayton@kernel.org> wrote:
>> On Fri, 2020-02-21 at 02:05 -0500, xiubli@redhat.com wrote:
>>> From: Xiubo Li <xiubli@redhat.com>
>>>
>>> It will calculate the latency for the metedata requests, which only
>>> include the time cousumed by network and the ceph.
>>>
>> "and the ceph MDS" ?
>>
>>> item total sum_lat(us) avg_lat(us)
>>> -----------------------------------------------------
>>> metadata 113 220000 1946
>>>
>>> URL: https://tracker.ceph.com/issues/43215
>>> Signed-off-by: Xiubo Li <xiubli@redhat.com>
>>> ---
>>> fs/ceph/debugfs.c | 6 ++++++
>>> fs/ceph/mds_client.c | 20 ++++++++++++++++++++
>>> fs/ceph/metric.h | 13 +++++++++++++
>>> 3 files changed, 39 insertions(+)
>>>
>>> diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c
>>> index 464bfbdb970d..60f3e307fca1 100644
>>> --- a/fs/ceph/debugfs.c
>>> +++ b/fs/ceph/debugfs.c
>>> @@ -146,6 +146,12 @@ static int metric_show(struct seq_file *s, void *p)
>>> avg = total ? sum / total : 0;
>>> seq_printf(s, "%-14s%-12lld%-16lld%lld\n", "write", total, sum, avg);
>>>
>>> + total = percpu_counter_sum(&mdsc->metric.total_metadatas);
>>> + sum = percpu_counter_sum(&mdsc->metric.metadata_latency_sum);
>>> + sum = jiffies_to_usecs(sum);
>>> + avg = total ? sum / total : 0;
>>> + seq_printf(s, "%-14s%-12lld%-16lld%lld\n", "metadata", total, sum, avg);
>>> +
>>> seq_printf(s, "\n");
>>> seq_printf(s, "item total miss hit\n");
>>> seq_printf(s, "-------------------------------------------------\n");
>>> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
>>> index 0a3447966b26..3e792eca6af7 100644
>>> --- a/fs/ceph/mds_client.c
>>> +++ b/fs/ceph/mds_client.c
>>> @@ -3017,6 +3017,12 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg)
>>>
>>> /* kick calling process */
>>> complete_request(mdsc, req);
>>> +
>>> + if (!result || result == -ENOENT) {
>>> + s64 latency = jiffies - req->r_started;
>>> +
>>> + ceph_update_metadata_latency(&mdsc->metric, latency);
>>> + }
>> Should we add an r_end_stamp field to the mds request struct and use
>> that to calculate this? Many jiffies may have passed between the reply
>> coming in and this point. If you really want to measure the latency that
>> would be more accurate, I think.
> Yes, capturing it after invoking the callback is inconsistent
> with what is done for OSD requests (the new r_end_stamp is set in
> finish_request()).
>
> It looks like this is the only place where MDS r_end_stamp would be
> needed, so perhaps just move this before complete_request() call?
Currently for the OSD requests, they are almost in the same place where
at the end of the handle_reply.
If we don't want to calculate the consumption by the most of
handle_reply code, we may set the r_end_stamp in the begin of it for
both OSD/MDS requests ?
I'm thinking since in the handle_reply, it may also wait for the mutex
locks and then sleeps, so move the r_end_stamp to the beginning should
make sense...
Thanks
BRs
> Thanks,
>
> Ilya
>
next prev parent reply other threads:[~2020-02-22 1:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-21 7:05 [PATCH v8 0/5] ceph: add perf metrics support xiubli
2020-02-21 7:05 ` [PATCH v8 1/5] ceph: add global dentry lease metric support xiubli
2020-02-21 7:05 ` [PATCH v8 2/5] ceph: add caps perf metric for each session xiubli
2020-02-21 12:00 ` Jeff Layton
2020-02-22 1:51 ` Xiubo Li
2020-02-26 3:05 ` Jeff Layton
2020-02-21 7:05 ` [PATCH v8 3/5] ceph: add global read latency metric support xiubli
2020-02-21 7:05 ` [PATCH v8 4/5] ceph: add global write " xiubli
2020-02-21 7:05 ` [PATCH v8 5/5] ceph: add global metadata perf " xiubli
2020-02-21 12:03 ` Jeff Layton
2020-02-21 14:56 ` Ilya Dryomov
2020-02-22 1:20 ` Xiubo Li [this message]
2020-02-22 1:36 ` Xiubo Li
2020-02-24 9:56 ` Ilya Dryomov
2020-02-24 10:20 ` Xiubo Li
2020-02-22 1:09 ` Xiubo Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8d977d6a-da80-5900-aead-395b9b4eaa76@redhat.com \
--to=xiubli@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=idryomov@gmail.com \
--cc=jlayton@kernel.org \
--cc=pdonnell@redhat.com \
--cc=sage@redhat.com \
--cc=zyan@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox