Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2982649 authored by Kenneth W Chen's avatar Kenneth W Chen Committed by Jens Axboe
Browse files

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: default avatarKen Chen <kenneth.w.chen@intel.com>
Signed-off-by: default avatarJens Axboe <axboe@suse.de>
parent 20e5c81f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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));