diff options
author | Dennis Zhou | 2019-05-23 22:10:18 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2019-07-26 09:14:09 +0200 |
commit | 3ae98dc2db1e937bda7cefdb9caadc653d865f58 (patch) | |
tree | fbbc5f42d37f0e7319d2bf29428e402e4ed73133 /block | |
parent | x86/cacheinfo: Fix a -Wtype-limits warning (diff) | |
download | kernel-qcow2-linux-3ae98dc2db1e937bda7cefdb9caadc653d865f58.tar.gz kernel-qcow2-linux-3ae98dc2db1e937bda7cefdb9caadc653d865f58.tar.xz kernel-qcow2-linux-3ae98dc2db1e937bda7cefdb9caadc653d865f58.zip |
blk-iolatency: only account submitted bios
[ Upstream commit a3fb01ba5af066521f3f3421839e501bb2c71805 ]
As is, iolatency recognizes done_bio and cleanup as ending paths. If a
request is marked REQ_NOWAIT and fails to get a request, the bio is
cleaned up via rq_qos_cleanup() and ended in bio_wouldblock_error().
This results in underflowing the inflight counter. Fix this by only
accounting bios that were actually submitted.
Signed-off-by: Dennis Zhou <dennis@kernel.org>
Cc: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-iolatency.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index 6b8396ccb5c4..75df47ad2e79 100644 --- a/block/blk-iolatency.c +++ b/block/blk-iolatency.c @@ -565,6 +565,10 @@ static void blkcg_iolatency_done_bio(struct rq_qos *rqos, struct bio *bio) if (!blkg) return; + /* We didn't actually submit this bio, don't account it. */ + if (bio->bi_status == BLK_STS_AGAIN) + return; + iolat = blkg_to_lat(bio->bi_blkg); if (!iolat) return; |