Skip to content

Commit 85686d0

Browse files
Algodev-githubaxboe
authored andcommitted
block, bfq: keep shared queues out of the waker mechanism
Shared queues are likely to receive I/O at a high rate. This may deceptively let them be considered as wakers of other queues. But a false waker will unjustly steal bandwidth to its supposedly woken queue. So considering also shared queues in the waking mechanism may cause more control troubles than throughput benefits. This commit keeps shared queues out of the waker-detection mechanism. Tested-by: Jan Kara <[email protected]> Signed-off-by: Paolo Valente <[email protected]> Tested-by: Oleksandr Natalenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 8c54477 commit 85686d0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

block/bfq-iosched.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5860,7 +5860,17 @@ static void bfq_completed_request(struct bfq_queue *bfqq, struct bfq_data *bfqd)
58605860
1UL<<(BFQ_RATE_SHIFT - 10))
58615861
bfq_update_rate_reset(bfqd, NULL);
58625862
bfqd->last_completion = now_ns;
5863-
bfqd->last_completed_rq_bfqq = bfqq;
5863+
/*
5864+
* Shared queues are likely to receive I/O at a high
5865+
* rate. This may deceptively let them be considered as wakers
5866+
* of other queues. But a false waker will unjustly steal
5867+
* bandwidth to its supposedly woken queue. So considering
5868+
* also shared queues in the waking mechanism may cause more
5869+
* control troubles than throughput benefits. Then do not set
5870+
* last_completed_rq_bfqq to bfqq if bfqq is a shared queue.
5871+
*/
5872+
if (!bfq_bfqq_coop(bfqq))
5873+
bfqd->last_completed_rq_bfqq = bfqq;
58645874

58655875
/*
58665876
* If we are waiting to discover whether the request pattern

0 commit comments

Comments
 (0)