From: Chen, Kenneth W Date: Thu, 13 Oct 2005 19:49:29 +0000 (+0200) Subject: Following the same idea, it occurs to me that we should only update X-Git-Tag: v2.6.15-rc1~733^2~4^2~1 X-Git-Url: http://pileus.org/git/?a=commitdiff_plain;h=b2982649ce38293b14684b26bcda20cfc54164e6;p=~andy%2Flinux 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 Signed-off-by: Jens Axboe --- diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c index c42071fd2e9..4e2b1b06b41 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));