Re: [PATCH v2] block: Do not pull requests from the scheduler when we cannot dispatch them

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/16/21 9:40 AM, Jan Kara wrote:
> On Thu 03-06-21 12:47:21, Jan Kara wrote:
>> Provided the device driver does not implement dispatch budget accounting
>> (which only SCSI does) the loop in __blk_mq_do_dispatch_sched() pulls
>> requests from the IO scheduler as long as it is willing to give out any.
>> That defeats scheduling heuristics inside the scheduler by creating
>> false impression that the device can take more IO when it in fact
>> cannot.
>>
>> For example with BFQ IO scheduler on top of virtio-blk device setting
>> blkio cgroup weight has barely any impact on observed throughput of
>> async IO because __blk_mq_do_dispatch_sched() always sucks out all the
>> IO queued in BFQ. BFQ first submits IO from higher weight cgroups but
>> when that is all dispatched, it will give out IO of lower weight cgroups
>> as well. And then we have to wait for all this IO to be dispatched to
>> the disk (which means lot of it actually has to complete) before the
>> IO scheduler is queried again for dispatching more requests. This
>> completely destroys any service differentiation.
>>
>> So grab request tag for a request pulled out of the IO scheduler already
>> in __blk_mq_do_dispatch_sched() and do not pull any more requests if we
>> cannot get it because we are unlikely to be able to dispatch it. That
>> way only single request is going to wait in the dispatch list for some
>> tag to free.
>>
>> Reviewed-by: Ming Lei <ming.lei@xxxxxxxxxx>
>> Signed-off-by: Jan Kara <jack@xxxxxxx>
>> ---
>>  block/blk-mq-sched.c | 12 +++++++++++-
>>  block/blk-mq.c       |  2 +-
>>  block/blk-mq.h       |  2 ++
>>  3 files changed, 14 insertions(+), 2 deletions(-)
>>
>> Jens, can you please merge the patch? Thanks!
> 
> Ping Jens?

Didn't I reply? It's merged for a while:

https://git.kernel.dk/cgit/linux-block/commit/?h=for-5.14/block&id=613471549f366cdf4170b81ce0f99f3867ec4d16

-- 
Jens Axboe




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux