block: only mark bio as tracked if it really is tracked
authorJens Axboe <axboe@kernel.dk>
Sat, 16 Oct 2021 02:06:18 +0000 (20:06 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jul 2022 14:34:57 +0000 (16:34 +0200)
commit13141cceadd07252880caea92b4617eed19c11cc
treec2d748bb89974c77be9640d0fcaecfe23a3390fa
parenteb79d1353cd0f2c04e1fc6311d7ce1d40a69b790
block: only mark bio as tracked if it really is tracked

[ Upstream commit 90b8faa0e8de1b02b619fb33f6c6e1e13e7d1d70 ]

We set BIO_TRACKED unconditionally when rq_qos_throttle() is called, even
though we may not even have an rq_qos handler. Only mark it as TRACKED if
it really is potentially tracked.

This saves considerable time for the case where the bio isn't tracked:

     2.64%     -1.65%  [kernel.vmlinux]  [k] bio_endio

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
block/blk-rq-qos.h