浏览代码

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 20 年之前
父节点
当前提交
b2982649ce
共有 1 个文件被更改,包括 3 次插入0 次删除
  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));