Skip to content

Commit 02a6d78

Browse files
Algodev-githubaxboe
authored andcommitted
block, bfq: do not overcharge writes in asymmetric scenarios
Writes tend to starve reads. bfq counters this problem by overcharging writes with an inflated service w.r.t. the actual service (number of sector written) they receive. Yet his overcharging is useless, and actually causes unfairness in the opposite direction, when bfq happens to be enforcing strong I/O control. bfq does this enforcing when the scenario is asymmetric, i.e., when some bfq_queue or group of bfq_queues is to be granted a different bandwidth than some other bfq_queue or group of bfq_queues. So, in such a scenario, this commit disables write overcharging. Signed-off-by: Paolo Valente <paolo.valente@linaro.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent b3c3498 commit 02a6d78

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎block/bfq-iosched.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,8 @@ static struct request *bfq_find_next_rq(struct bfq_data *bfqd,
888888
static unsigned long bfq_serv_to_charge(struct request *rq,
889889
struct bfq_queue *bfqq)
890890
{
891-
if (bfq_bfqq_sync(bfqq) || bfqq->wr_coeff > 1)
891+
if (bfq_bfqq_sync(bfqq) || bfqq->wr_coeff > 1 ||
892+
!bfq_symmetric_scenario(bfqq->bfqd))
892893
return blk_rq_sectors(rq);
893894

894895
return blk_rq_sectors(rq) * bfq_async_charge_factor;

0 commit comments

Comments
 (0)