Commit 7e8c288f authored by Lars Ellenberg's avatar Lars Ellenberg Committed by Jens Axboe

drbd: move start io accounting before activity log transaction

The IO accounting of the drbd "queue depth" was misleading.
We only started IO accounting once we already wrote the activity log.
Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 08a1ddab
...@@ -1056,6 +1056,9 @@ drbd_request_prepare(struct drbd_conf *mdev, struct bio *bio, unsigned long star ...@@ -1056,6 +1056,9 @@ drbd_request_prepare(struct drbd_conf *mdev, struct bio *bio, unsigned long star
req->private_bio = NULL; req->private_bio = NULL;
} }
/* Update disk stats */
_drbd_start_io_acct(mdev, req);
if (rw == WRITE && req->private_bio && req->i.size if (rw == WRITE && req->private_bio && req->i.size
&& !test_bit(AL_SUSPENDED, &mdev->flags)) { && !test_bit(AL_SUSPENDED, &mdev->flags)) {
if (!drbd_al_begin_io_fastpath(mdev, &req->i)) { if (!drbd_al_begin_io_fastpath(mdev, &req->i)) {
...@@ -1095,9 +1098,6 @@ static void drbd_send_and_submit(struct drbd_conf *mdev, struct drbd_request *re ...@@ -1095,9 +1098,6 @@ static void drbd_send_and_submit(struct drbd_conf *mdev, struct drbd_request *re
goto out; goto out;
} }
/* Update disk stats */
_drbd_start_io_acct(mdev, req);
/* We fail READ/READA early, if we can not serve it. /* We fail READ/READA early, if we can not serve it.
* We must do this before req is registered on any lists. * We must do this before req is registered on any lists.
* Otherwise, drbd_req_complete() will queue failed READ for retry. */ * Otherwise, drbd_req_complete() will queue failed READ for retry. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment