Skip to contentSkip to conversation

enhanced I/O accounting data collection

PATCH Jens Axboe 2 participants 2 messages Sep 28, 2004 – Sep 29, 2004

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

Hi,

Quoted 13 lines

Index: linux/drivers/block/ll_rw_blk.c
===================================================================

drivers/block/ll_rw_blk.c +1 -0
@@ -1741,6 +1741,7 @@
 {
 	DEFINE_WAIT(wait);
 	struct request *rq;
+	unsigned long start_wait = jiffies;
 
 	generic_unplug_device(q);
 	do {

drivers/block/ll_rw_blk.c line 1775

Quoted 6 lines
drivers/block/ll_rw_blk.c +1 -0
@@ -1769,6 +1770,7 @@
 		finish_wait(&rl->wait[rw], &wait);
 	} while (!rq);
 
+	current->bwtime += (unsigned long) jiffies - start_wait;
 	return rq;
 }

What is the purpose of this hunk alone as block io accounting? It doesn't make any sense to me - you are accounting the time a process spends sleeping on a congested queue, it has nothing to do with the bandwidth time it used. Which, btw, isn't so easy to account on queueing hardware.

Just curious on what you are trying to achieve here.

Signature · 1 line
Jens Axboe
#1 lore raw

You are right, Jens. In our earlier posting, we also included block device read/write counters. The block read/write counts are not very accurate but it fits our customers' needs since they used that information sort of for performance analysis than for accounting purpose.

Thus the block read/write counters were removed from our patch so that we can concentrate on the accounting needs. This bwtime (block wait time) should have been pulled together with block read/write counters.

Regards,
- jay

Quoted 32 lines · Jens Axboe

Hi,

Quoted 13 lines

Index: linux/drivers/block/ll_rw_blk.c
===================================================================

drivers/block/ll_rw_blk.c +1 -0
@@ -1741,6 +1741,7 @@
 {
 	DEFINE_WAIT(wait);
 	struct request *rq;
+	unsigned long start_wait = jiffies;
 
 	generic_unplug_device(q);
 	do {

drivers/block/ll_rw_blk.c line 1775

Quoted 6 lines
drivers/block/ll_rw_blk.c +1 -0
@@ -1769,6 +1770,7 @@
 		finish_wait(&rl->wait[rw], &wait);
 	} while (!rq);
 
+	current->bwtime += (unsigned long) jiffies - start_wait;
 	return rq;
 }

What is the purpose of this hunk alone as block io accounting? It doesn't make any sense to me - you are accounting the time a process spends sleeping on a congested queue, it has nothing to do with the bandwidth time it used. Which, btw, isn't so easy to account on queueing hardware.

Just curious on what you are trying to achieve here.