Browse Source

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>

Chen, Kenneth W 19 years ago
parent
commit
b2982649ce
1 changed files with 3 additions and 0 deletions
  1. 3 0
      drivers/block/ll_rw_blk.c

+ 3 - 0
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));