[Drbd-dev] [PATCH RFC 3/5] drbd: rename start_jif to start_ns
Guoqing Jiang
guoqing.jiang at cloud.ionos.com
Mon Oct 12 17:43:45 CEST 2020
Let's rename start_jif to start_ns to reflect that bio_start_io_acct
returns ns presicion now.
Cc: Philipp Reisner <philipp.reisner at linbit.com>
Cc: Lars Ellenberg <lars.ellenberg at linbit.com>
Cc: drbd-dev at lists.linbit.com
Signed-off-by: Guoqing Jiang <guoqing.jiang at cloud.ionos.com>
---
drivers/block/drbd/drbd_debugfs.c | 8 ++++----
drivers/block/drbd/drbd_int.h | 2 +-
drivers/block/drbd/drbd_req.c | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/block/drbd/drbd_debugfs.c b/drivers/block/drbd/drbd_debugfs.c
index b3b9cd5628fd..672fd7e6587d 100644
--- a/drivers/block/drbd/drbd_debugfs.c
+++ b/drivers/block/drbd/drbd_debugfs.c
@@ -105,7 +105,7 @@ static void seq_print_one_request(struct seq_file *m, struct drbd_request *req,
(s & RQ_WRITE) ? "W" : "R");
#define RQ_HDR_2 "\tstart\tin AL\tsubmit"
- seq_printf(m, "\t%d", jiffies_to_msecs(now - req->start_jif));
+ seq_printf(m, "\t%llu", (ktime_get_ns() - req->start_ns) / NSEC_PER_MSEC);
seq_print_age_or_dash(m, s & RQ_IN_ACT_LOG, now - req->in_actlog_jif);
seq_print_age_or_dash(m, s & RQ_LOCAL_PENDING, now - req->pre_submit_jif);
@@ -161,7 +161,7 @@ static void seq_print_waiting_for_AL(struct seq_file *m, struct drbd_resource *r
seq_puts(m, "minor\tvnr\tage\t#waiting\n");
rcu_read_lock();
idr_for_each_entry(&resource->devices, device, i) {
- unsigned long jif;
+ unsigned long ns;
struct drbd_request *req;
int n = atomic_read(&device->ap_actlog_cnt);
if (n) {
@@ -171,7 +171,7 @@ static void seq_print_waiting_for_AL(struct seq_file *m, struct drbd_resource *r
/* if the oldest request does not wait for the activity log
* it is not interesting for us here */
if (req && !(req->rq_state & RQ_IN_ACT_LOG))
- jif = req->start_jif;
+ ns = req->start_ns;
else
req = NULL;
spin_unlock_irq(&device->resource->req_lock);
@@ -179,7 +179,7 @@ static void seq_print_waiting_for_AL(struct seq_file *m, struct drbd_resource *r
if (n) {
seq_printf(m, "%u\t%u\t", device->minor, device->vnr);
if (req)
- seq_printf(m, "%u\t", jiffies_to_msecs(now - jif));
+ seq_printf(m, "%llu\t", (ktime_get_ns() - ns) / NSEC_PER_MSEC);
else
seq_puts(m, "-\t");
seq_printf(m, "%u\n", n);
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index aacd2010b555..467d96316230 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -301,7 +301,7 @@ struct drbd_request {
struct list_head req_pending_local;
/* for generic IO accounting */
- unsigned long start_jif;
+ unsigned long start_ns;
/* for DRBD internal statistics */
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index f705128b4f27..6ad6b4470ebd 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -245,7 +245,7 @@ void drbd_req_complete(struct drbd_request *req, struct bio_and_error *m)
start_new_tl_epoch(first_peer_device(device)->connection);
/* Update disk stats */
- bio_end_io_acct(req->master_bio, req->start_jif);
+ bio_end_io_acct(req->master_bio, req->start_ns);
/* If READ failed,
* have it be pushed back to the retry work queue,
@@ -1206,7 +1206,7 @@ drbd_request_prepare(struct drbd_device *device, struct bio *bio)
}
/* Update disk stats */
- req->start_jif = bio_start_io_acct(req->master_bio);
+ req->start_ns = bio_start_io_acct(req->master_bio);
if (!get_ldev(device)) {
bio_put(req->private_bio);
--
2.17.1
More information about the drbd-dev
mailing list