From patchwork Tue Feb 15 09:16:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venky Shankar X-Patchwork-Id: 12746745 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B877C433EF for ; Tue, 15 Feb 2022 09:17:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235754AbiBOJRT (ORCPT ); Tue, 15 Feb 2022 04:17:19 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:44974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235753AbiBOJRT (ORCPT ); Tue, 15 Feb 2022 04:17:19 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0881AAE6F for ; Tue, 15 Feb 2022 01:17:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644916629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Eiu+Fs9WTha6ja/10Sm+YNnaJJVJZmbeDmhwpLOfjS8=; b=aOuFsUtL1447G8AgfZJfSSv7F0Z6w0kgjBSVuZkDBig2UbCJc7kQGwgrhXRwPcrSREOhLd YJd4aDa02yDnjTOuOIzGXTC4lGl+RRzy2QNDVB+mnczgGV27tF4f0Fu04TNaujqpSZFr/L UKneUVaqSNr41VIhgQHvXO35gELlaBw= Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-517-fk6E_0HUMCmqcSJNx5zUuQ-1; Tue, 15 Feb 2022 04:17:08 -0500 X-MC-Unique: fk6E_0HUMCmqcSJNx5zUuQ-1 Received: by mail-pj1-f71.google.com with SMTP id q40-20020a17090a17ab00b001bafa89b70aso636060pja.2 for ; Tue, 15 Feb 2022 01:17:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Eiu+Fs9WTha6ja/10Sm+YNnaJJVJZmbeDmhwpLOfjS8=; b=R4wmpNHvPlv5GjbPN9e9sOtboo89spOzmZQcw1RpNt4pUyia1TAXHgycxfDsL9we8r l6wmfwUlWNI2Q9xexwu6MZCrhgxUVauOd6wGh7OlsRD3R41xZF54jVJ6CQC7O79Gqb27 zTz5qjfuCmct9MemdvPr2pkgBlJDZl57X1w4Yx0qGmRYdu/aQ3JSyE+Fc++aHxDSvVfi eR4NdUl81H+OSVIKy3Dqazwh8V9XUjDXEreab3zpTd4AzcMK/a0YBanwdH1DwOPN8aYU 6UqTMAcZyTkEd+LD9ovhDXw043YZauUlzCNL+R9VLT+ZNP5AASUYl47wyNS2Zx0kDB4A UfMA== X-Gm-Message-State: AOAM530wZIDdgubquVhZPLOWTDPo3DcZcOVVKHGmIB3Im2Fso1zJNwOi iOIqZlqd39Re8B+0A3UEXu8R+9VjeTo1LeSUddfGrVY43xSVqD2RR0aVCV3vavSsPssaCj0hAO6 OSu/jSyv3nanDWDqEBNh+Qg== X-Received: by 2002:a17:902:c40b:: with SMTP id k11mr3230575plk.58.1644916626653; Tue, 15 Feb 2022 01:17:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJzx29bGiHjkeGNXKvV+ch5hYkiSOUz7ifGwfDHdmyFhvbG/k/nAb0WuHowQlpAsB/GVADJTTA== X-Received: by 2002:a17:902:c40b:: with SMTP id k11mr3230554plk.58.1644916626401; Tue, 15 Feb 2022 01:17:06 -0800 (PST) Received: from h3ckers-pride.redhat.com ([124.123.80.180]) by smtp.gmail.com with ESMTPSA id kk14sm16569550pjb.26.2022.02.15.01.17.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 01:17:05 -0800 (PST) From: Venky Shankar To: jlayton@redhat.com, xiubli@redhat.com Cc: ceph-devel@vger.kernel.org, Venky Shankar Subject: [PATCH 1/3] ceph: track average r/w/m latency Date: Tue, 15 Feb 2022 14:46:55 +0530 Message-Id: <20220215091657.104079-2-vshankar@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220215091657.104079-1-vshankar@redhat.com> References: <20220215091657.104079-1-vshankar@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Make the math a bit simpler to understand (should not effect execution speeds). Signed-off-by: Venky Shankar --- fs/ceph/metric.c | 29 +++++++++++++++-------------- fs/ceph/metric.h | 1 + 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/fs/ceph/metric.c b/fs/ceph/metric.c index a9cd23561a0d..73e98d45442a 100644 --- a/fs/ceph/metric.c +++ b/fs/ceph/metric.c @@ -250,6 +250,7 @@ int ceph_metric_init(struct ceph_client_metric *m) metric->size_max = 0; metric->total = 0; metric->latency_sum = 0; + metric->latency_avg = 0; metric->latency_sq_sum = 0; metric->latency_min = KTIME_MAX; metric->latency_max = 0; @@ -307,20 +308,19 @@ void ceph_metric_destroy(struct ceph_client_metric *m) max = new; \ } -static inline void __update_stdev(ktime_t total, ktime_t lsum, - ktime_t *sq_sump, ktime_t lat) +static inline void __update_mean_and_stdev(ktime_t total, ktime_t *lavg, + ktime_t *sq_sump, ktime_t lat) { - ktime_t avg, sq; - - if (unlikely(total == 1)) - return; - - /* the sq is (lat - old_avg) * (lat - new_avg) */ - avg = DIV64_U64_ROUND_CLOSEST((lsum - lat), (total - 1)); - sq = lat - avg; - avg = DIV64_U64_ROUND_CLOSEST(lsum, total); - sq = sq * (lat - avg); - *sq_sump += sq; + ktime_t avg; + + if (unlikely(total == 1)) { + *lavg = lat; + } else { + /* the sq is (lat - old_avg) * (lat - new_avg) */ + avg = *lavg + div64_s64(lat - *lavg, total); + *sq_sump += (lat - *lavg)*(lat - avg); + *lavg = avg; + } } void ceph_update_metrics(struct ceph_metric *m, @@ -339,6 +339,7 @@ void ceph_update_metrics(struct ceph_metric *m, METRIC_UPDATE_MIN_MAX(m->size_min, m->size_max, size); m->latency_sum += lat; METRIC_UPDATE_MIN_MAX(m->latency_min, m->latency_max, lat); - __update_stdev(total, m->latency_sum, &m->latency_sq_sum, lat); + __update_mean_and_stdev(total, &m->latency_avg, &m->latency_sq_sum, + lat); spin_unlock(&m->lock); } diff --git a/fs/ceph/metric.h b/fs/ceph/metric.h index 5b2bb2897056..c47ba0074e49 100644 --- a/fs/ceph/metric.h +++ b/fs/ceph/metric.h @@ -137,6 +137,7 @@ struct ceph_metric { u64 size_min; u64 size_max; ktime_t latency_sum; + ktime_t latency_avg; ktime_t latency_sq_sum; ktime_t latency_min; ktime_t latency_max; From patchwork Tue Feb 15 09:16:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venky Shankar X-Patchwork-Id: 12746746 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C50DC433F5 for ; Tue, 15 Feb 2022 09:17:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235763AbiBOJRZ (ORCPT ); Tue, 15 Feb 2022 04:17:25 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:45506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235753AbiBOJRY (ORCPT ); Tue, 15 Feb 2022 04:17:24 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F300DAE54 for ; Tue, 15 Feb 2022 01:17:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644916634; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C7tx8Dzct8q7hKQEHq3Uz7bCH+72mRHOiuvjImObc5Q=; b=GFJ5JZ/Gle7soXJoSW/lxVKV6+14MM3/sJYsQrPfvQfjmQnogkNbyKAfgKl28DceJ2xG/8 1p/t63Dtbz5zsAuJLW5OlO0USEbfLVpOukcf9ZbPJJ6cTG0vInSmbhm0LQ0n62+3ZBNriQ feym/pTESgm8jKRzTslFHE6/yaB3ppI= Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-641-4HYAV0nUNHWDrTaSda2lgg-1; Tue, 15 Feb 2022 04:17:13 -0500 X-MC-Unique: 4HYAV0nUNHWDrTaSda2lgg-1 Received: by mail-pj1-f71.google.com with SMTP id f2-20020a17090a4a8200b001b7dac53bd6so12721462pjh.4 for ; Tue, 15 Feb 2022 01:17:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C7tx8Dzct8q7hKQEHq3Uz7bCH+72mRHOiuvjImObc5Q=; b=Gzoq9H+zwloAEcOi1JkK/1fSoQZTuOoeDgp1lo4GEw8IPehCxv4UXg33jolll91oAA RelJkQyg8G5N9zLElt71G70sI1xWbLhBfAij9G0UY/koAZnnHsVzDlxv72cg1ECJ0LXX emSdVvUXrO+gVHO5Hq90MdLe7RIURDQX2AwBnnG53FnpyV7+sn+Lj+HN6UFOHdPO7VY2 VX5pS2VmFqFftimCXMzjBKyY1hKnuCCjXobRsOJ3NuFs/oI50JHPgut0czzL/wjVFtiV GxwWq795+GVg7e40ZlaiOeP9c85yPSBTU/8e94PikBwzgJL/m+Bzla5RGP1UrgMerCjE mZlw== X-Gm-Message-State: AOAM5303W+N8TsrFvUyg0af7DobJM5MHYuoivtxJH4yGWizIVcaYQTNl DOJWCLYPlH1+nqaxZ3mUJx8B01V0pMVMHAvpTvC8zjLsmpukTjRmnnw2B+2IZLi+NaGmgWpzvlB eY0ySnbTZ3GhHFPj6Sq3THA== X-Received: by 2002:a17:90a:5890:: with SMTP id j16mr3278531pji.185.1644916631970; Tue, 15 Feb 2022 01:17:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJymWAX17iUlBl/LBTj9s0RbkCLzSIk8PVLzM4O+J41VMU1bjrb0z3K4QJnuTJ/XWKp7BA0i4w== X-Received: by 2002:a17:90a:5890:: with SMTP id j16mr3278518pji.185.1644916631771; Tue, 15 Feb 2022 01:17:11 -0800 (PST) Received: from h3ckers-pride.redhat.com ([124.123.80.180]) by smtp.gmail.com with ESMTPSA id kk14sm16569550pjb.26.2022.02.15.01.17.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 01:17:11 -0800 (PST) From: Venky Shankar To: jlayton@redhat.com, xiubli@redhat.com Cc: ceph-devel@vger.kernel.org, Venky Shankar Subject: [PATCH 2/3] ceph: include average/stdev r/w/m latency in mds metrics Date: Tue, 15 Feb 2022 14:46:56 +0530 Message-Id: <20220215091657.104079-3-vshankar@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220215091657.104079-1-vshankar@redhat.com> References: <20220215091657.104079-1-vshankar@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org stdev is computed in `cephfs-top` tool - clients forward square of sums and IO count required to calculate stdev. Signed-off-by: Venky Shankar --- fs/ceph/metric.c | 15 +++++++++++--- fs/ceph/metric.h | 51 ++++++++++++++++++++++++++++++++++-------------- 2 files changed, 48 insertions(+), 18 deletions(-) diff --git a/fs/ceph/metric.c b/fs/ceph/metric.c index 73e98d45442a..5842da86c2bf 100644 --- a/fs/ceph/metric.c +++ b/fs/ceph/metric.c @@ -65,31 +65,40 @@ static bool ceph_mdsc_send_metrics(struct ceph_mds_client *mdsc, /* encode the read latency metric */ read = (struct ceph_metric_read_latency *)(cap + 1); read->header.type = cpu_to_le32(CLIENT_METRIC_TYPE_READ_LATENCY); - read->header.ver = 1; + read->header.ver = 2; read->header.compat = 1; read->header.data_len = cpu_to_le32(sizeof(*read) - header_len); sum = m->metric[METRIC_READ].latency_sum; to_ceph_timespec(&read->lat, sum); + to_ceph_timespec(&read->avg, m->metric[METRIC_READ].latency_avg); + read->sq_sum = cpu_to_le64(m->metric[METRIC_READ].latency_sq_sum); + read->count = cpu_to_le64(m->metric[METRIC_READ].total); items++; /* encode the write latency metric */ write = (struct ceph_metric_write_latency *)(read + 1); write->header.type = cpu_to_le32(CLIENT_METRIC_TYPE_WRITE_LATENCY); - write->header.ver = 1; + write->header.ver = 2; write->header.compat = 1; write->header.data_len = cpu_to_le32(sizeof(*write) - header_len); sum = m->metric[METRIC_WRITE].latency_sum; to_ceph_timespec(&write->lat, sum); + to_ceph_timespec(&write->avg, m->metric[METRIC_WRITE].latency_avg); + write->sq_sum = cpu_to_le64(m->metric[METRIC_WRITE].latency_sq_sum); + write->count = cpu_to_le64(m->metric[METRIC_WRITE].total); items++; /* encode the metadata latency metric */ meta = (struct ceph_metric_metadata_latency *)(write + 1); meta->header.type = cpu_to_le32(CLIENT_METRIC_TYPE_METADATA_LATENCY); - meta->header.ver = 1; + meta->header.ver = 2; meta->header.compat = 1; meta->header.data_len = cpu_to_le32(sizeof(*meta) - header_len); sum = m->metric[METRIC_METADATA].latency_sum; to_ceph_timespec(&meta->lat, sum); + to_ceph_timespec(&meta->avg, m->metric[METRIC_METADATA].latency_avg); + meta->sq_sum = cpu_to_le64(m->metric[METRIC_METADATA].latency_sq_sum); + meta->count = cpu_to_le64(m->metric[METRIC_METADATA].total); items++; /* encode the dentry lease metric */ diff --git a/fs/ceph/metric.h b/fs/ceph/metric.h index c47ba0074e49..0d0c44bd3332 100644 --- a/fs/ceph/metric.h +++ b/fs/ceph/metric.h @@ -19,27 +19,39 @@ enum ceph_metric_type { CLIENT_METRIC_TYPE_OPENED_INODES, CLIENT_METRIC_TYPE_READ_IO_SIZES, CLIENT_METRIC_TYPE_WRITE_IO_SIZES, - - CLIENT_METRIC_TYPE_MAX = CLIENT_METRIC_TYPE_WRITE_IO_SIZES, + CLIENT_METRIC_TYPE_AVG_READ_LATENCY, + CLIENT_METRIC_TYPE_STDEV_READ_LATENCY, + CLIENT_METRIC_TYPE_AVG_WRITE_LATENCY, + CLIENT_METRIC_TYPE_STDEV_WRITE_LATENCY, + CLIENT_METRIC_TYPE_AVG_METADATA_LATENCY, + CLIENT_METRIC_TYPE_STDEV_METADATA_LATENCY, + + CLIENT_METRIC_TYPE_MAX = CLIENT_METRIC_TYPE_STDEV_METADATA_LATENCY, }; /* * This will always have the highest metric bit value * as the last element of the array. */ -#define CEPHFS_METRIC_SPEC_CLIENT_SUPPORTED { \ - CLIENT_METRIC_TYPE_CAP_INFO, \ - CLIENT_METRIC_TYPE_READ_LATENCY, \ - CLIENT_METRIC_TYPE_WRITE_LATENCY, \ - CLIENT_METRIC_TYPE_METADATA_LATENCY, \ - CLIENT_METRIC_TYPE_DENTRY_LEASE, \ - CLIENT_METRIC_TYPE_OPENED_FILES, \ - CLIENT_METRIC_TYPE_PINNED_ICAPS, \ - CLIENT_METRIC_TYPE_OPENED_INODES, \ - CLIENT_METRIC_TYPE_READ_IO_SIZES, \ - CLIENT_METRIC_TYPE_WRITE_IO_SIZES, \ - \ - CLIENT_METRIC_TYPE_MAX, \ +#define CEPHFS_METRIC_SPEC_CLIENT_SUPPORTED { \ + CLIENT_METRIC_TYPE_CAP_INFO, \ + CLIENT_METRIC_TYPE_READ_LATENCY, \ + CLIENT_METRIC_TYPE_WRITE_LATENCY, \ + CLIENT_METRIC_TYPE_METADATA_LATENCY, \ + CLIENT_METRIC_TYPE_DENTRY_LEASE, \ + CLIENT_METRIC_TYPE_OPENED_FILES, \ + CLIENT_METRIC_TYPE_PINNED_ICAPS, \ + CLIENT_METRIC_TYPE_OPENED_INODES, \ + CLIENT_METRIC_TYPE_READ_IO_SIZES, \ + CLIENT_METRIC_TYPE_WRITE_IO_SIZES, \ + CLIENT_METRIC_TYPE_AVG_READ_LATENCY, \ + CLIENT_METRIC_TYPE_STDEV_READ_LATENCY, \ + CLIENT_METRIC_TYPE_AVG_WRITE_LATENCY, \ + CLIENT_METRIC_TYPE_STDEV_WRITE_LATENCY, \ + CLIENT_METRIC_TYPE_AVG_METADATA_LATENCY, \ + CLIENT_METRIC_TYPE_STDEV_METADATA_LATENCY, \ + \ + CLIENT_METRIC_TYPE_MAX, \ } struct ceph_metric_header { @@ -61,18 +73,27 @@ struct ceph_metric_cap { struct ceph_metric_read_latency { struct ceph_metric_header header; struct ceph_timespec lat; + struct ceph_timespec avg; + __le64 sq_sum; + __le64 count; } __packed; /* metric write latency header */ struct ceph_metric_write_latency { struct ceph_metric_header header; struct ceph_timespec lat; + struct ceph_timespec avg; + __le64 sq_sum; + __le64 count; } __packed; /* metric metadata latency header */ struct ceph_metric_metadata_latency { struct ceph_metric_header header; struct ceph_timespec lat; + struct ceph_timespec avg; + __le64 sq_sum; + __le64 count; } __packed; /* metric dentry lease header */ From patchwork Tue Feb 15 09:16:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venky Shankar X-Patchwork-Id: 12746747 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 483DDC433F5 for ; Tue, 15 Feb 2022 09:17:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235761AbiBOJR3 (ORCPT ); Tue, 15 Feb 2022 04:17:29 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:45804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235756AbiBOJR1 (ORCPT ); Tue, 15 Feb 2022 04:17:27 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2A625AE6F for ; Tue, 15 Feb 2022 01:17:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644916637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l2r1jag2B8h4t60u9CLI6iIx/Tf0zjMI4sQzIQznIOc=; b=Psh51opM3HYZO84qGTUkCLYooewneQBIcWewPlxSxAqfXpZZYaG6BimCaKcJtLve50b5TD nuisbX9mzZYd3Qt8vj3UIQ98K6flOG8koIcnYFh1VmdhHT7c4FdO69UvhpMZLJHQlQcpCE 8SIDT6Z1afce9UcPlxbJd7O6rhIrOTo= Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-640-OgJk7zinOyqvGvdxxyKaQQ-1; Tue, 15 Feb 2022 04:17:16 -0500 X-MC-Unique: OgJk7zinOyqvGvdxxyKaQQ-1 Received: by mail-pj1-f71.google.com with SMTP id 62-20020a17090a09c400b001b80b0742b0so12714017pjo.8 for ; Tue, 15 Feb 2022 01:17:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l2r1jag2B8h4t60u9CLI6iIx/Tf0zjMI4sQzIQznIOc=; b=OZnhrI+1B11lYKlLk5E7tTZqHUhsMHDDq2hSWRj1attlAg2prMM4ZDZ2X+Svqp1n3m YR20gU8RmdxLAV6K704gHZ59mkrtDhs+KmP/0aLE6/NJ6sYclMoQcdKJMkrM3GblKOX9 0GkacidxAdydciXc7KXlUsuRtIOWd3i9fUmbwjgmNOP0CT8/TIK0FWJSpGAUPi7taLwM h37rtEzBvLS1SEMtwwIRqCpDwnVFoFaAAFabApq+m5wUcP0BaGlgwzjVbdAWgQSq5xCY qXd6bT5weIJm9U/MiHLrmnPoeagTKibkfEwVulKwnGFzMEkO6Y8xEjMnrqNV3i5y0CIC ou5A== X-Gm-Message-State: AOAM533B5dzmDpVcNEDZ8uWBwbqsH5CNZERv9l7EjoV2XpvtssCLP/kq IHHLmEyFi0713SCsZx8fCMXGwRrruTRwPTEZ0x1C5n8Tc6QsMU3GKx99WS09HMqci9gqx7sw1g2 zuafUlR3m7Cy4PIAGsO//dg== X-Received: by 2002:a17:90b:4d86:b0:1b9:c571:53a0 with SMTP id oj6-20020a17090b4d8600b001b9c57153a0mr3344822pjb.242.1644916634757; Tue, 15 Feb 2022 01:17:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJsKDdglWW3zCEKG7G41eYJIjaFmWe3oVFO470/l9BWIiHaqUpmvOLyKYAQNtiAy6qu9MFjg== X-Received: by 2002:a17:90b:4d86:b0:1b9:c571:53a0 with SMTP id oj6-20020a17090b4d8600b001b9c57153a0mr3344810pjb.242.1644916634511; Tue, 15 Feb 2022 01:17:14 -0800 (PST) Received: from h3ckers-pride.redhat.com ([124.123.80.180]) by smtp.gmail.com with ESMTPSA id kk14sm16569550pjb.26.2022.02.15.01.17.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 01:17:13 -0800 (PST) From: Venky Shankar To: jlayton@redhat.com, xiubli@redhat.com Cc: ceph-devel@vger.kernel.org, Venky Shankar Subject: [PATCH 3/3] ceph: use tracked average r/w/m latencies to display metrics in debugfs Date: Tue, 15 Feb 2022 14:46:57 +0530 Message-Id: <20220215091657.104079-4-vshankar@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220215091657.104079-1-vshankar@redhat.com> References: <20220215091657.104079-1-vshankar@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Signed-off-by: Venky Shankar --- fs/ceph/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c index 3cf7c9c1085b..acc5cb3ad0ef 100644 --- a/fs/ceph/debugfs.c +++ b/fs/ceph/debugfs.c @@ -186,7 +186,7 @@ static int metrics_latency_show(struct seq_file *s, void *p) spin_lock(&m->lock); total = m->total; sum = m->latency_sum; - avg = total > 0 ? DIV64_U64_ROUND_CLOSEST(sum, total) : 0; + avg = m->latency_avg; min = m->latency_min; max = m->latency_max; sq = m->latency_sq_sum;