mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
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<[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
84c124da9f
commit
812d402648
7 changed files with 57 additions and 1 deletions
|
|
@ -1467,6 +1467,14 @@ static void cfq_merged_request(struct request_queue *q, struct request *req,
|
|||
}
|
||||
}
|
||||
|
||||
static void cfq_bio_merged(struct request_queue *q, struct request *req,
|
||||
struct bio *bio)
|
||||
{
|
||||
struct cfq_queue *cfqq = RQ_CFQQ(req);
|
||||
blkiocg_update_io_merged_stats(&cfqq->cfqg->blkg, bio_data_dir(bio),
|
||||
cfq_bio_sync(bio));
|
||||
}
|
||||
|
||||
static void
|
||||
cfq_merged_requests(struct request_queue *q, struct request *rq,
|
||||
struct request *next)
|
||||
|
|
@ -1484,6 +1492,8 @@ cfq_merged_requests(struct request_queue *q, struct request *rq,
|
|||
if (cfqq->next_rq == next)
|
||||
cfqq->next_rq = rq;
|
||||
cfq_remove_request(next);
|
||||
blkiocg_update_io_merged_stats(&cfqq->cfqg->blkg, rq_data_dir(next),
|
||||
rq_is_sync(next));
|
||||
}
|
||||
|
||||
static int cfq_allow_merge(struct request_queue *q, struct request *rq,
|
||||
|
|
@ -3861,6 +3871,7 @@ static struct elevator_type iosched_cfq = {
|
|||
.elevator_merged_fn = cfq_merged_request,
|
||||
.elevator_merge_req_fn = cfq_merged_requests,
|
||||
.elevator_allow_merge_fn = cfq_allow_merge,
|
||||
.elevator_bio_merged_fn = cfq_bio_merged,
|
||||
.elevator_dispatch_fn = cfq_dispatch_requests,
|
||||
.elevator_add_req_fn = cfq_insert_request,
|
||||
.elevator_activate_req_fn = cfq_activate_request,
|
||||
|
|
|
|||
Loading…
Reference in a new issue