Re: [PATCH v3] block: Limit number of items taken from the I/O scheduler in one go

From: Christoph Hellwig
Date: Fri Apr 24 2020 - 11:39:59 EST


> + /*
> + * A return of -EAGAIN is an indication that hctx->dispatch is not
> + * empty and we must run again in order to avoid starving flushes.
> + */
> + if (__blk_mq_sched_dispatch_requests(hctx) == -EAGAIN) {
> + if (__blk_mq_sched_dispatch_requests(hctx) == -EAGAIN)
> + blk_mq_run_hw_queue(hctx, true);
> + }

The comment doesn't explain why we give up after the second attempt and
do a blk_mq_run_hw_queue instead.