lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9e2de812-4ca7-3560-08ea-a346944c05d6@linux.alibaba.com>
Date:   Fri, 20 Dec 2019 14:16:38 +0800
From:   Wen Yang <wenyang@...ux.alibaba.com>
To:     Jens Axboe <axboe@...nel.dk>
Cc:     Joseph Qi <joseph.qi@...ux.alibaba.com>, xlpang@...ux.alibaba.com,
        Mikulas Patocka <mpatocka@...hat.com>,
        Mike Snitzer <snitzer@...hat.com>, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] block: make the io_ticks counter more accurate



On 2019/12/18 9:28 上午, Jens Axboe wrote:
> On 12/17/19 7:28 AM, Wen Yang wrote:
>> Instead of the jiffies, we should update the io_ticks counter
>> with the passed in parameter 'now'.
> 
> But they are not the same clock source...
> 

Hi Jens,
Thanks for your comments.
We plan to change it to the following version,
please kindly help with some suggestions.
Thank you.


diff --git a/block/blk-core.c b/block/blk-core.c
index 379f6f5..da7de9f 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1365,7 +1365,7 @@ void blk_account_io_done(struct request *req, u64 now)
  		part_stat_lock();
  		part = req->part;

-		update_io_ticks(part, jiffies);
+		update_io_ticks(part, nsecs_to_jiffies(now));
  		part_stat_inc(part, ios[sgrp]);
  		part_stat_add(part, nsecs[sgrp], now - req->start_time_ns);
  		part_stat_add(part, time_in_queue, nsecs_to_jiffies64(now - 
req->start_time_ns));
@@ -1407,7 +1407,7 @@ void blk_account_io_start(struct request *rq, bool 
new_io)
  		rq->part = part;
  	}

-	update_io_ticks(part, jiffies);
+	update_io_ticks(part, nsecs_to_jiffies(ktime_get_ns()));

  	part_stat_unlock();
  }
--
1.8.3.1


--
Best Regards,
Wen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ