Re: [PATCH v2] block/mq-deadline: adjust the timeout period of the per_prio->dispatch
From: Tao pilgrim
Date: Thu Oct 09 2025 - 22:03:56 EST
On Fri, Oct 10, 2025 at 7:40 AM Bart Van Assche <bvanassche@xxxxxxx> wrote:
>
>
> On 10/9/25 1:21 PM, Damien Le Moal wrote:
> > There is still something bothering me with this: the request is added to the
> > dispatch list, and *NOT* to the fifo/sort list. So this should be considered as
> > a scheduling decision in itself, and __dd_dispatch_request() reflects that as
> > the first thing it does is pick the requests that are in the dispatch list
> > already. However, __dd_dispatch_request() also has the check:
> >
> > if (started_after(dd, rq, latest_start))
> > return NULL;
> >
> > for requests that are already in the dispatch list. That is what does not make
> > sense to me. Why ? There is no comment describing this. And I do not understand
> > why we should bother with any time for requests that are in the dispatch list
> > already. These should be sent to the drive first, always.
> >
> > This patch seems to be fixing a problem that is introduced by the above check.
> > But why this check ? What am I missing here ?
>
> Is my conclusion from the above correct that there is agreement that the
> I/O priority should be ignored for AT HEAD requests and that AT HEAD
> requests should always be dispatched first? If so, how about merging the
> three per I/O priority dispatch lists into a single dispatch list and
> not to call started_after() at all for the dispatch list?
>From the current kernel strategy perspective, the dispatch list does
not fundamentally
differ from the fifo/sort list. It essentially treats AT HEAD requests
as higher-priority
requests compared to regular ones, storing them separately in the
dispatch list. When
I/O scheduling is triggered, the kernel's priority consideration
follows this hierarchy:
(rt/be/idle priorities) > (expired requests in dispatch list)
> (expired requests in fifo/sort list) > (non-expired requests
in dispatch list)
> (non-expired requests in fifo/sort list).
I speculate the original design intent addresses scenarios where
requests accumulate
in the dispatch list. The kernel must first scan for expired requests
within the dispatch
list for prioritized processing, while also positioning expired
requests from the fifo/sort
list higher in priority than non-expired requests in the dispatch list.
To merge the three per I/O priority dispatch lists into a single
dispatch list, prerequisite
conditions must be met: ensuring no request backlog occurs in the
dispatch list that
could cause starvation or frequent deadline violations for requests in
the fifo/sort lists.
--
Yours,
Kaitao Cheng