public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] optimize disk_round_stats
@ 2005-10-13 19:19 Chen, Kenneth W
  2005-10-13 19:22 ` Jens Axboe
  2005-10-14 10:19 ` Arjan van de Ven
  0 siblings, 2 replies; 4+ messages in thread
From: Chen, Kenneth W @ 2005-10-13 19:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: 'Jens Axboe'

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>

--- ./drivers/block/ll_rw_blk.c.orig	2005-10-13 11:54:07.474907379 -0700
+++ ./drivers/block/ll_rw_blk.c	2005-10-13 11:54:39.074516367 -0700
@@ -2433,6 +2433,9 @@ void disk_round_stats(struct gendisk *di
 {
 	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));




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-10-14 19:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-13 19:19 [patch] optimize disk_round_stats Chen, Kenneth W
2005-10-13 19:22 ` Jens Axboe
2005-10-14 10:19 ` Arjan van de Ven
2005-10-14 19:16   ` Chen, Kenneth W

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox