summaryrefslogtreecommitdiffstats
path: root/drivers/block/ll_rw_blk.c
diff options
context:
space:
mode:
authorChen, Kenneth W <kenneth.w.chen@intel.com>2005-10-13 21:49:29 +0200
committerJens Axboe <axboe@nelson.home.kernel.dk>2005-10-28 08:15:43 +0200
commitb2982649ce38293b14684b26bcda20cfc54164e6 (patch)
tree8208c0cd33f2565f0f193d0afab282a7d0778382 /drivers/block/ll_rw_blk.c
parent20e5c81fcff89535dced2ed71cf24c6c648ff40e (diff)
downloadop-kernel-dev-b2982649ce38293b14684b26bcda20cfc54164e6.zip
op-kernel-dev-b2982649ce38293b14684b26bcda20cfc54164e6.tar.gz
Following the same idea, it occurs to me that we should only update
disk stat when "now" is different from disk->stamp. Otherwise, we are again needlessly adding zero to the stats. Signed-off-by: Ken Chen <kenneth.w.chen@intel.com> Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'drivers/block/ll_rw_blk.c')
-rw-r--r--drivers/block/ll_rw_blk.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c
index c42071f..4e2b1b0 100644
--- a/drivers/block/ll_rw_blk.c
+++ b/drivers/block/ll_rw_blk.c
@@ -2433,6 +2433,9 @@ void disk_round_stats(struct gendisk *disk)
{
unsigned long now = jiffies;
+ if (now == disk->stamp)
+ return;
+
if (disk->in_flight) {
__disk_stat_add(disk, time_in_queue,
disk->in_flight * (now - disk->stamp));
OpenPOWER on IntegriCloud