diff options
author | Nikanth Karthikesan <knikanth@suse.de> | 2009-09-11 03:18:54 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-09-14 02:24:52 -0400 |
commit | a9327cac440be4d8333bba975cbbf76045096275 (patch) | |
tree | 83fd5dc45dc925c5b4eb0264c3add96cfaa4cae6 /block/blk-core.c | |
parent | 18d8217bc441630c3c5ec7416c5a65c69e8a0979 (diff) |
Seperate read and write statistics of in_flight requests
Currently, there is a single in_flight counter measuring the number of
requests in the request_queue. But some monitoring tools would like to
know how many read requests and write requests are in progress. Split the
current in_flight counter into two seperate counters for read and write.
This information is exported as a sysfs attribute, as changing the
currently available stat files would break the existing tools.
Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 982d634e67f9..182ebe3eb9e0 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -69,7 +69,7 @@ static void drive_stat_acct(struct request *rq, int new_io) | |||
69 | part_stat_inc(cpu, part, merges[rw]); | 69 | part_stat_inc(cpu, part, merges[rw]); |
70 | else { | 70 | else { |
71 | part_round_stats(cpu, part); | 71 | part_round_stats(cpu, part); |
72 | part_inc_in_flight(part); | 72 | part_inc_in_flight(part, rw); |
73 | } | 73 | } |
74 | 74 | ||
75 | part_stat_unlock(); | 75 | part_stat_unlock(); |
@@ -1030,7 +1030,7 @@ static void part_round_stats_single(int cpu, struct hd_struct *part, | |||
1030 | 1030 | ||
1031 | if (part->in_flight) { | 1031 | if (part->in_flight) { |
1032 | __part_stat_add(cpu, part, time_in_queue, | 1032 | __part_stat_add(cpu, part, time_in_queue, |
1033 | part->in_flight * (now - part->stamp)); | 1033 | part_in_flight(part) * (now - part->stamp)); |
1034 | __part_stat_add(cpu, part, io_ticks, (now - part->stamp)); | 1034 | __part_stat_add(cpu, part, io_ticks, (now - part->stamp)); |
1035 | } | 1035 | } |
1036 | part->stamp = now; | 1036 | part->stamp = now; |
@@ -1737,7 +1737,7 @@ static void blk_account_io_done(struct request *req) | |||
1737 | part_stat_inc(cpu, part, ios[rw]); | 1737 | part_stat_inc(cpu, part, ios[rw]); |
1738 | part_stat_add(cpu, part, ticks[rw], duration); | 1738 | part_stat_add(cpu, part, ticks[rw], duration); |
1739 | part_round_stats(cpu, part); | 1739 | part_round_stats(cpu, part); |
1740 | part_dec_in_flight(part); | 1740 | part_dec_in_flight(part, rw); |
1741 | 1741 | ||
1742 | part_stat_unlock(); | 1742 | part_stat_unlock(); |
1743 | } | 1743 | } |