From: xiubli@redhat.com
To: jlayton@kernel.org
Cc: sage@redhat.com, idryomov@gmail.com, gfarnum@redhat.com,
zyan@redhat.com, pdonnell@redhat.com, ceph-devel@vger.kernel.org,
Xiubo Li <xiubli@redhat.com>
Subject: [PATCH v4 1/4] ceph: switch to DIV64_U64_ROUND_CLOSEST to support 32-bit arches
Date: Wed, 18 Mar 2020 01:45:52 -0400 [thread overview]
Message-ID: <1584510355-6936-2-git-send-email-xiubli@redhat.com> (raw)
In-Reply-To: <1584510355-6936-1-git-send-email-xiubli@redhat.com>
From: Xiubo Li <xiubli@redhat.com>
fs/ceph/debugfs.c:140: undefined reference to `__divdi3'
Use math64 helpers to avoid 64-bit div on 32-bit arches.
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Xiubo Li <xiubli@redhat.com>
---
fs/ceph/debugfs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c
index 60f3e307..95e8693 100644
--- a/fs/ceph/debugfs.c
+++ b/fs/ceph/debugfs.c
@@ -137,19 +137,19 @@ static int metric_show(struct seq_file *s, void *p)
total = percpu_counter_sum(&mdsc->metric.total_reads);
sum = percpu_counter_sum(&mdsc->metric.read_latency_sum);
sum = jiffies_to_usecs(sum);
- avg = total ? sum / total : 0;
+ avg = total ? DIV64_U64_ROUND_CLOSEST(sum, total) : 0;
seq_printf(s, "%-14s%-12lld%-16lld%lld\n", "read", total, sum, avg);
total = percpu_counter_sum(&mdsc->metric.total_writes);
sum = percpu_counter_sum(&mdsc->metric.write_latency_sum);
sum = jiffies_to_usecs(sum);
- avg = total ? sum / total : 0;
+ avg = total ? DIV64_U64_ROUND_CLOSEST(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;
+ avg = total ? DIV64_U64_ROUND_CLOSEST(sum, total) : 0;
seq_printf(s, "%-14s%-12lld%-16lld%lld\n", "metadata", total, sum, avg);
seq_printf(s, "\n");
--
1.8.3.1
next prev parent reply other threads:[~2020-03-18 5:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-18 5:45 [PATCH v4 0/4] ceph: add min/max/stdev latency support xiubli
2020-03-18 5:45 ` xiubli [this message]
2020-03-18 5:45 ` [PATCH v4 2/4] ceph: add min/max latency support for read/write/metadata metrics xiubli
2020-03-18 5:45 ` [PATCH v4 3/4] ceph: move the metric helpers into one separate file xiubli
2020-03-18 5:45 ` [PATCH v4 4/4] ceph: add standard deviation support for read/write/metadata perf metric xiubli
2020-03-18 9:11 ` [PATCH v4 0/4] ceph: add min/max/stdev latency support Ilya Dryomov
2020-03-18 10:36 ` Xiubo Li
2020-03-18 10:43 ` Jeff Layton
2020-03-18 10:50 ` 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=1584510355-6936-2-git-send-email-xiubli@redhat.com \
--to=xiubli@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=gfarnum@redhat.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.