mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 08:03:01 +09:00
block, bfq: consider also ioprio classes in symmetry detection
In asymmetric scenarios, i.e., when some bfq_queue or bfq_group needs to be guaranteed a different bandwidth than other bfq_queues or bfq_groups, these service guaranteed can be provided only by plugging I/O dispatch, completely or partially, when the queue in service remains temporarily empty. A case where asymmetry is particularly strong is when some active bfq_queues belong to a higher-priority class than some other active bfq_queues. Unfortunately, this important case is not considered at all in the code for detecting asymmetric scenarios. This commit adds the missing logic. Signed-off-by: Paolo Valente <paolo.valente@linaro.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
committed by
Jens Axboe
parent
03e565e420
commit
73d5811849
@@ -44,6 +44,12 @@ static unsigned int bfq_class_idx(struct bfq_entity *entity)
|
||||
BFQ_DEFAULT_GRP_CLASS - 1;
|
||||
}
|
||||
|
||||
unsigned int bfq_tot_busy_queues(struct bfq_data *bfqd)
|
||||
{
|
||||
return bfqd->busy_queues[0] + bfqd->busy_queues[1] +
|
||||
bfqd->busy_queues[2];
|
||||
}
|
||||
|
||||
static struct bfq_entity *bfq_lookup_next_entity(struct bfq_sched_data *sd,
|
||||
bool expiration);
|
||||
|
||||
@@ -1513,7 +1519,7 @@ struct bfq_queue *bfq_get_next_queue(struct bfq_data *bfqd)
|
||||
struct bfq_sched_data *sd;
|
||||
struct bfq_queue *bfqq;
|
||||
|
||||
if (bfqd->busy_queues == 0)
|
||||
if (bfq_tot_busy_queues(bfqd) == 0)
|
||||
return NULL;
|
||||
|
||||
/*
|
||||
@@ -1665,7 +1671,7 @@ void bfq_del_bfqq_busy(struct bfq_data *bfqd, struct bfq_queue *bfqq,
|
||||
|
||||
bfq_clear_bfqq_busy(bfqq);
|
||||
|
||||
bfqd->busy_queues--;
|
||||
bfqd->busy_queues[bfqq->ioprio_class - 1]--;
|
||||
|
||||
if (!bfqq->dispatched)
|
||||
bfq_weights_tree_remove(bfqd, bfqq);
|
||||
@@ -1688,7 +1694,7 @@ void bfq_add_bfqq_busy(struct bfq_data *bfqd, struct bfq_queue *bfqq)
|
||||
bfq_activate_bfqq(bfqd, bfqq);
|
||||
|
||||
bfq_mark_bfqq_busy(bfqq);
|
||||
bfqd->busy_queues++;
|
||||
bfqd->busy_queues[bfqq->ioprio_class - 1]++;
|
||||
|
||||
if (!bfqq->dispatched)
|
||||
if (bfqq->wr_coeff == 1)
|
||||
|
||||
Reference in New Issue
Block a user