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>
This commit is contained in:
Chen, Kenneth W 2005-10-13 21:49:29 +02:00 committed by Jens Axboe
parent 20e5c81fcf
commit b2982649ce

View File

@ -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));