Skip to content

Commit

Permalink
Following the same idea, it occurs to me that we should only update
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chen, Kenneth W authored and Jens Axboe committed Oct 28, 2005
1 parent 20e5c81 commit b298264
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/block/ll_rw_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit b298264

Please sign in to comment.