diff options
author | Konstantin Khlebnikov <khlebnikov@yandex-team.ru> | 2020-05-27 07:24:15 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-05-27 13:21:23 +0200 |
commit | b9c54f5660e7eff10dd2ddd1eae554573105b15d (patch) | |
tree | 905b560633e7b217ed955451ba31932d38e6cc8c /block/blk-merge.c | |
parent | block: always use a percpu variable for disk stats (diff) | |
download | linux-b9c54f5660e7eff10dd2ddd1eae554573105b15d.tar.xz linux-b9c54f5660e7eff10dd2ddd1eae554573105b15d.zip |
block: account merge of two requests
Also rename blk_account_io_merge() into blk_account_io_merge_request() to
distinguish it from merging request and bio.
[hch: rebased]
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-merge.c')
-rw-r--r-- | block/blk-merge.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/block/blk-merge.c b/block/blk-merge.c index 6a4538d39efd..c3beae5c1be7 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -669,18 +669,16 @@ void blk_rq_set_mixed_merge(struct request *rq) rq->rq_flags |= RQF_MIXED_MERGE; } -static void blk_account_io_merge(struct request *req) +static void blk_account_io_merge_request(struct request *req) { if (blk_do_io_stat(req)) { - struct hd_struct *part; - part_stat_lock(); - part = req->part; - - hd_struct_put(part); + part_stat_inc(req->part, merges[op_stat_group(req_op(req))]); + hd_struct_put(req->part); part_stat_unlock(); } } + /* * Two cases of handling DISCARD merge: * If max_discard_segments > 1, the driver takes every bio @@ -792,7 +790,7 @@ static struct request *attempt_merge(struct request_queue *q, /* * 'next' is going away, so update stats accordingly */ - blk_account_io_merge(next); + blk_account_io_merge_request(next); /* * ownership of bio passed from next to req, return 'next' for |