diff options
author | Jerome Marchand <jmarchan@redhat.com> | 2009-04-22 14:01:49 +0200 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-04-24 08:54:21 +0200 |
commit | 42dad7647aec49b3ad20dd0cb832b232a6ae514f (patch) | |
tree | b70d4cb7706f2647e65426e24f078ddf14d6e139 /block/blk-merge.c | |
parent | pktcdvd.h should include mempool.h (diff) | |
download | linux-42dad7647aec49b3ad20dd0cb832b232a6ae514f.tar.xz linux-42dad7647aec49b3ad20dd0cb832b232a6ae514f.zip |
block: simplify I/O stat accounting
This simplifies I/O stat accounting switching code and separates it
completely from I/O scheduler switch code.
Requests are accounted according to the state of their request queue
at the time of the request allocation. There is no need anymore to
flush the request queue when switching I/O accounting state.
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-merge.c')
-rw-r--r-- | block/blk-merge.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/block/blk-merge.c b/block/blk-merge.c index 63760ca3da0f..23d2a6fe34a3 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -402,7 +402,10 @@ static int attempt_merge(struct request_queue *q, struct request *req, elv_merge_requests(q, req, next); - blk_account_io_merge(req); + /* + * 'next' is going away, so update stats accordingly + */ + blk_account_io_merge(next); req->ioprio = ioprio_best(req->ioprio, next->ioprio); if (blk_rq_cpu_valid(next)) |