Skip to content

Commit 20cd324

Browse files
Algodev-githubaxboe
authored andcommitted
block, bfq: do not consider interactive queues in srt filtering
The speed at which a bfq_queue receives I/O is one of the parameters by which bfq decides whether the queue is soft real-time (i.e., whether the queue contains the I/O of a soft real-time application). In particular, when a bfq_queue remains without outstanding I/O requests, bfq computes the minimum time instant, named soft_rt_next_start, at which the next request of the queue may arrive for the queue to be deemed as soft real time. Unfortunately this filtering may cause problems with a queue in interactive weight raising. In fact, such a queue may be conveying the I/O needed to load a soft real-time application. The latter will actually exhibit a soft real-time I/O pattern after it finally starts doing its job. But, if soft_rt_next_start is updated for an interactive bfq_queue, and the queue has received a lot of service before remaining with no outstanding request (likely to happen on a fast device), then soft_rt_next_start is assigned such a high value that, for a very long time, the queue is prevented from being possibly considered as soft real time. This commit removes the updating of soft_rt_next_start for bfq_queues in interactive weight raising. Signed-off-by: Paolo Valente <paolo.valente@linaro.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 22cb4e6 commit 20cd324

File tree

1 file changed

+29
-10
lines changed

1 file changed

+29
-10
lines changed

block/bfq-iosched.c

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3274,16 +3274,32 @@ void bfq_bfqq_expire(struct bfq_data *bfqd,
32743274
* requests, then the request pattern is isochronous
32753275
* (see the comments on the function
32763276
* bfq_bfqq_softrt_next_start()). Thus we can compute
3277-
* soft_rt_next_start. If, instead, the queue still
3278-
* has outstanding requests, then we have to wait for
3279-
* the completion of all the outstanding requests to
3280-
* discover whether the request pattern is actually
3281-
* isochronous.
3277+
* soft_rt_next_start. And we do it, unless bfqq is in
3278+
* interactive weight raising. We do not do it in the
3279+
* latter subcase, for the following reason. bfqq may
3280+
* be conveying the I/O needed to load a soft
3281+
* real-time application. Such an application will
3282+
* actually exhibit a soft real-time I/O pattern after
3283+
* it finally starts doing its job. But, if
3284+
* soft_rt_next_start is computed here for an
3285+
* interactive bfqq, and bfqq had received a lot of
3286+
* service before remaining with no outstanding
3287+
* request (likely to happen on a fast device), then
3288+
* soft_rt_next_start would be assigned such a high
3289+
* value that, for a very long time, bfqq would be
3290+
* prevented from being possibly considered as soft
3291+
* real time.
3292+
*
3293+
* If, instead, the queue still has outstanding
3294+
* requests, then we have to wait for the completion
3295+
* of all the outstanding requests to discover whether
3296+
* the request pattern is actually isochronous.
32823297
*/
3283-
if (bfqq->dispatched == 0)
3298+
if (bfqq->dispatched == 0 &&
3299+
bfqq->wr_coeff != bfqd->bfq_wr_coeff)
32843300
bfqq->soft_rt_next_start =
32853301
bfq_bfqq_softrt_next_start(bfqd, bfqq);
3286-
else {
3302+
else if (bfqq->dispatched > 0) {
32873303
/*
32883304
* Schedule an update of soft_rt_next_start to when
32893305
* the task may be discovered to be isochronous.
@@ -4834,11 +4850,14 @@ static void bfq_completed_request(struct bfq_queue *bfqq, struct bfq_data *bfqd)
48344850
* isochronous, and both requisites for this condition to hold
48354851
* are now satisfied, then compute soft_rt_next_start (see the
48364852
* comments on the function bfq_bfqq_softrt_next_start()). We
4837-
* schedule this delayed check when bfqq expires, if it still
4838-
* has in-flight requests.
4853+
* do not compute soft_rt_next_start if bfqq is in interactive
4854+
* weight raising (see the comments in bfq_bfqq_expire() for
4855+
* an explanation). We schedule this delayed update when bfqq
4856+
* expires, if it still has in-flight requests.
48394857
*/
48404858
if (bfq_bfqq_softrt_update(bfqq) && bfqq->dispatched == 0 &&
4841-
RB_EMPTY_ROOT(&bfqq->sort_list))
4859+
RB_EMPTY_ROOT(&bfqq->sort_list) &&
4860+
bfqq->wr_coeff != bfqd->bfq_wr_coeff)
48424861
bfqq->soft_rt_next_start =
48434862
bfq_bfqq_softrt_next_start(bfqd, bfqq);
48444863

0 commit comments

Comments
 (0)