提交 277a4a9b 编写于 作者: P Paolo Valente 提交者: Jens Axboe

block, bfq: give a better name to bfq_bfqq_may_idle

The actual goal of the function bfq_bfqq_may_idle is to tell whether
it is better to perform device idling (more precisely: I/O-dispatch
plugging) for the input bfq_queue, either to boost throughput or to
preserve service guarantees. This commit improves the name of the
function accordingly.
Tested-by: NHolger Hoffstätte <holger@applied-asynchrony.com>
Tested-by: NOleksandr Natalenko <oleksandr@natalenko.name>
Signed-off-by: NPaolo Valente <paolo.valente@linaro.org>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 9fae8dd5
...@@ -634,7 +634,7 @@ static bool bfq_differentiated_weights(struct bfq_data *bfqd) ...@@ -634,7 +634,7 @@ static bool bfq_differentiated_weights(struct bfq_data *bfqd)
* The following function returns true if every queue must receive the * The following function returns true if every queue must receive the
* same share of the throughput (this condition is used when deciding * same share of the throughput (this condition is used when deciding
* whether idling may be disabled, see the comments in the function * whether idling may be disabled, see the comments in the function
* bfq_bfqq_may_idle()). * bfq_better_to_idle()).
* *
* Such a scenario occurs when: * Such a scenario occurs when:
* 1) all active queues have the same weight, * 1) all active queues have the same weight,
...@@ -3355,7 +3355,7 @@ static bool bfq_may_expire_for_budg_timeout(struct bfq_queue *bfqq) ...@@ -3355,7 +3355,7 @@ static bool bfq_may_expire_for_budg_timeout(struct bfq_queue *bfqq)
* issues taken into account are not trivial. We discuss these issues * issues taken into account are not trivial. We discuss these issues
* individually while introducing the variables. * individually while introducing the variables.
*/ */
static bool bfq_bfqq_may_idle(struct bfq_queue *bfqq) static bool bfq_better_to_idle(struct bfq_queue *bfqq)
{ {
struct bfq_data *bfqd = bfqq->bfqd; struct bfq_data *bfqd = bfqq->bfqd;
bool rot_without_queueing = bool rot_without_queueing =
...@@ -3588,19 +3588,19 @@ static bool bfq_bfqq_may_idle(struct bfq_queue *bfqq) ...@@ -3588,19 +3588,19 @@ static bool bfq_bfqq_may_idle(struct bfq_queue *bfqq)
} }
/* /*
* If the in-service queue is empty but the function bfq_bfqq_may_idle * If the in-service queue is empty but the function bfq_better_to_idle
* returns true, then: * returns true, then:
* 1) the queue must remain in service and cannot be expired, and * 1) the queue must remain in service and cannot be expired, and
* 2) the device must be idled to wait for the possible arrival of a new * 2) the device must be idled to wait for the possible arrival of a new
* request for the queue. * request for the queue.
* See the comments on the function bfq_bfqq_may_idle for the reasons * See the comments on the function bfq_better_to_idle for the reasons
* why performing device idling is the best choice to boost the throughput * why performing device idling is the best choice to boost the throughput
* and preserve service guarantees when bfq_bfqq_may_idle itself * and preserve service guarantees when bfq_better_to_idle itself
* returns true. * returns true.
*/ */
static bool bfq_bfqq_must_idle(struct bfq_queue *bfqq) static bool bfq_bfqq_must_idle(struct bfq_queue *bfqq)
{ {
return RB_EMPTY_ROOT(&bfqq->sort_list) && bfq_bfqq_may_idle(bfqq); return RB_EMPTY_ROOT(&bfqq->sort_list) && bfq_better_to_idle(bfqq);
} }
/* /*
...@@ -3686,7 +3686,7 @@ static struct bfq_queue *bfq_select_queue(struct bfq_data *bfqd) ...@@ -3686,7 +3686,7 @@ static struct bfq_queue *bfq_select_queue(struct bfq_data *bfqd)
* may idle after their completion, then keep it anyway. * may idle after their completion, then keep it anyway.
*/ */
if (bfq_bfqq_wait_request(bfqq) || if (bfq_bfqq_wait_request(bfqq) ||
(bfqq->dispatched != 0 && bfq_bfqq_may_idle(bfqq))) { (bfqq->dispatched != 0 && bfq_better_to_idle(bfqq))) {
bfqq = NULL; bfqq = NULL;
goto keep_queue; goto keep_queue;
} }
...@@ -4734,7 +4734,7 @@ static void bfq_completed_request(struct bfq_queue *bfqq, struct bfq_data *bfqd) ...@@ -4734,7 +4734,7 @@ static void bfq_completed_request(struct bfq_queue *bfqq, struct bfq_data *bfqd)
BFQQE_BUDGET_TIMEOUT); BFQQE_BUDGET_TIMEOUT);
else if (RB_EMPTY_ROOT(&bfqq->sort_list) && else if (RB_EMPTY_ROOT(&bfqq->sort_list) &&
(bfqq->dispatched == 0 || (bfqq->dispatched == 0 ||
!bfq_bfqq_may_idle(bfqq))) !bfq_better_to_idle(bfqq)))
bfq_bfqq_expire(bfqd, bfqq, false, bfq_bfqq_expire(bfqd, bfqq, false,
BFQQE_NO_MORE_REQUESTS); BFQQE_NO_MORE_REQUESTS);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册