aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-core.c
diff options
context:
space:
mode:
authorDivyesh Shah <dpshah@google.com>2010-04-09 00:14:23 -0400
committerJens Axboe <jens.axboe@oracle.com>2010-04-09 02:36:07 -0400
commit812d402648f4fc1ab1091b2172a46fc1b367c724 (patch)
tree9dc52d5bfdbc170559169a0157ed3295d551e9cf /block/blk-core.c
parent84c124da9ff50bd71fab9c939ee5b7cd8bef2bd9 (diff)
blkio: Add io_merged stat
This includes both the number of bios merged into requests belonging to this cgroup as well as the number of requests merged together. In the past, we've observed different merging behavior across upstream kernels, some by design some actual bugs. This stat helps a lot in debugging such problems when applications report decreased throughput with a new kernel version. This needed adding an extra elevator function to capture bios being merged as I did not want to pollute elevator code with blkiocg knowledge and hence needed the accounting invocation to come from CFQ. Signed-off-by: Divyesh Shah<dpshah@google.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r--block/blk-core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 4b1b29ef2cb0..e9a5ae25db8c 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1202,6 +1202,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
1202 if (!blk_rq_cpu_valid(req)) 1202 if (!blk_rq_cpu_valid(req))
1203 req->cpu = bio->bi_comp_cpu; 1203 req->cpu = bio->bi_comp_cpu;
1204 drive_stat_acct(req, 0); 1204 drive_stat_acct(req, 0);
1205 elv_bio_merged(q, req, bio);
1205 if (!attempt_back_merge(q, req)) 1206 if (!attempt_back_merge(q, req))
1206 elv_merged_request(q, req, el_ret); 1207 elv_merged_request(q, req, el_ret);
1207 goto out; 1208 goto out;
@@ -1235,6 +1236,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
1235 if (!blk_rq_cpu_valid(req)) 1236 if (!blk_rq_cpu_valid(req))
1236 req->cpu = bio->bi_comp_cpu; 1237 req->cpu = bio->bi_comp_cpu;
1237 drive_stat_acct(req, 0); 1238 drive_stat_acct(req, 0);
1239 elv_bio_merged(q, req, bio);
1238 if (!attempt_front_merge(q, req)) 1240 if (!attempt_front_merge(q, req))
1239 elv_merged_request(q, req, el_ret); 1241 elv_merged_request(q, req, el_ret);
1240 goto out; 1242 goto out;