]> git.baikalelectronics.ru Git - kernel.git/commit
block, bfq: make bfq_has_work() more accurate
authorYu Kuai <yukuai3@huawei.com>
Fri, 13 May 2022 02:35:07 +0000 (10:35 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 16 May 2022 17:39:20 +0000 (11:39 -0600)
commitb847d03873f74394a136c2b471b3e19e6b70e3f4
tree42e97d04b7d1155d8c68e00b876780930ed7bc61
parent29f1b3ade5e06c36f31c078b955a32ca2778a1f9
block, bfq: make bfq_has_work() more accurate

bfq_has_work() is using busy_queues currently, which is not accurate
because bfq_queue is busy doesn't represent that it has requests. Since
bfqd aready has a counter 'queued' to record how many requests are in
bfq, use it instead of busy_queues.

Noted that bfq_has_work() can be called with 'bfqd->lock' held, thus the
lock can't be held in bfq_has_work() to protect 'bfqd->queued'.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220513023507.2625717-3-yukuai3@huawei.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bfq-iosched.c