* [PATCH -next v3 0/6] multiple cleanup patches for bfq
@ 2022-05-28 9:59 Yu Kuai
2022-05-28 9:59 ` [PATCH -next v3 1/6] block, bfq: cleanup bfq_weights_tree add/remove apis Yu Kuai
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Yu Kuai @ 2022-05-28 9:59 UTC (permalink / raw)
To: paolo.valente, axboe, tj
Cc: linux-block, cgroups, linux-kernel, yukuai3, yi.zhang
Resend just in case v2 end up in spam (for Paolo).
Changes in v2:
- add missing blank line in patch 1.
- remove patch 7,8, since they are wrong.
- add reviewed-by tag
There are no functional changes in this patchset, just some places
that I think can be improved during code review.
Previous version:
v1: https://lore.kernel.org/all/20220514090522.1669270-1-yukuai3@huawei.com/
Yu Kuai (6):
block, bfq: cleanup bfq_weights_tree add/remove apis
block, bfq: cleanup __bfq_weights_tree_remove()
block, bfq: factor out code to update 'active_entities'
block, bfq: don't declare 'bfqd' as type 'void *' in bfq_group
block, bfq: cleanup bfq_activate_requeue_entity()
block, bfq: remove dead code for updating 'rq_in_driver'
block/bfq-cgroup.c | 2 +-
block/bfq-iosched.c | 38 +++----------------
block/bfq-iosched.h | 11 ++----
block/bfq-wf2q.c | 91 ++++++++++++++++++++-------------------------
4 files changed, 51 insertions(+), 91 deletions(-)
--
2.31.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH -next v3 1/6] block, bfq: cleanup bfq_weights_tree add/remove apis
2022-05-28 9:59 [PATCH -next v3 0/6] multiple cleanup patches for bfq Yu Kuai
@ 2022-05-28 9:59 ` Yu Kuai
2022-05-28 9:59 ` [PATCH -next v3 2/6] block, bfq: cleanup __bfq_weights_tree_remove() Yu Kuai
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Yu Kuai @ 2022-05-28 9:59 UTC (permalink / raw)
To: paolo.valente, axboe, tj
Cc: linux-block, cgroups, linux-kernel, yukuai3, yi.zhang
They already pass 'bfqd' as the first parameter, there is no need to
pass 'bfqd->queue_weights_tree' as another parameter.
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
---
block/bfq-iosched.c | 13 +++++++------
block/bfq-iosched.h | 10 +++-------
block/bfq-wf2q.c | 16 +++++-----------
3 files changed, 15 insertions(+), 24 deletions(-)
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index ffbc2d1593af..2315cfbe46e7 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -870,9 +870,9 @@ static bool bfq_asymmetric_scenario(struct bfq_data *bfqd,
* In most scenarios, the rate at which nodes are created/destroyed
* should be low too.
*/
-void bfq_weights_tree_add(struct bfq_data *bfqd, struct bfq_queue *bfqq,
- struct rb_root_cached *root)
+void bfq_weights_tree_add(struct bfq_data *bfqd, struct bfq_queue *bfqq)
{
+ struct rb_root_cached *root = &bfqd->queue_weights_tree;
struct bfq_entity *entity = &bfqq->entity;
struct rb_node **new = &(root->rb_root.rb_node), *parent = NULL;
bool leftmost = true;
@@ -945,12 +945,14 @@ void bfq_weights_tree_add(struct bfq_data *bfqd, struct bfq_queue *bfqq,
* about overhead.
*/
void __bfq_weights_tree_remove(struct bfq_data *bfqd,
- struct bfq_queue *bfqq,
- struct rb_root_cached *root)
+ struct bfq_queue *bfqq)
{
+ struct rb_root_cached *root;
+
if (!bfqq->weight_counter)
return;
+ root = &bfqd->queue_weights_tree;
bfqq->weight_counter->num_active--;
if (bfqq->weight_counter->num_active > 0)
goto reset_entity_pointer;
@@ -970,8 +972,7 @@ void __bfq_weights_tree_remove(struct bfq_data *bfqd,
void bfq_weights_tree_remove(struct bfq_data *bfqd,
struct bfq_queue *bfqq)
{
- __bfq_weights_tree_remove(bfqd, bfqq,
- &bfqd->queue_weights_tree);
+ __bfq_weights_tree_remove(bfqd, bfqq);
}
/*
diff --git a/block/bfq-iosched.h b/block/bfq-iosched.h
index 6c6cd984d769..50c554134196 100644
--- a/block/bfq-iosched.h
+++ b/block/bfq-iosched.h
@@ -933,13 +933,9 @@ struct bfq_queue *bic_to_bfqq(struct bfq_io_cq *bic, bool is_sync);
void bic_set_bfqq(struct bfq_io_cq *bic, struct bfq_queue *bfqq, bool is_sync);
struct bfq_data *bic_to_bfqd(struct bfq_io_cq *bic);
void bfq_pos_tree_add_move(struct bfq_data *bfqd, struct bfq_queue *bfqq);
-void bfq_weights_tree_add(struct bfq_data *bfqd, struct bfq_queue *bfqq,
- struct rb_root_cached *root);
-void __bfq_weights_tree_remove(struct bfq_data *bfqd,
- struct bfq_queue *bfqq,
- struct rb_root_cached *root);
-void bfq_weights_tree_remove(struct bfq_data *bfqd,
- struct bfq_queue *bfqq);
+void bfq_weights_tree_add(struct bfq_data *bfqd, struct bfq_queue *bfqq);
+void __bfq_weights_tree_remove(struct bfq_data *bfqd, struct bfq_queue *bfqq);
+void bfq_weights_tree_remove(struct bfq_data *bfqd, struct bfq_queue *bfqq);
void bfq_bfqq_expire(struct bfq_data *bfqd, struct bfq_queue *bfqq,
bool compensate, enum bfqq_expiration reason);
void bfq_put_queue(struct bfq_queue *bfqq);
diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c
index 48ca7922035c..03949c20494d 100644
--- a/block/bfq-wf2q.c
+++ b/block/bfq-wf2q.c
@@ -731,7 +731,6 @@ __bfq_entity_update_weight_prio(struct bfq_service_tree *old_st,
struct bfq_queue *bfqq = bfq_entity_to_bfqq(entity);
unsigned int prev_weight, new_weight;
struct bfq_data *bfqd = NULL;
- struct rb_root_cached *root;
#ifdef CONFIG_BFQ_GROUP_IOSCHED
struct bfq_sched_data *sd;
struct bfq_group *bfqg;
@@ -794,19 +793,15 @@ __bfq_entity_update_weight_prio(struct bfq_service_tree *old_st,
* queue, remove the entity from its old weight counter (if
* there is a counter associated with the entity).
*/
- if (prev_weight != new_weight && bfqq) {
- root = &bfqd->queue_weights_tree;
- __bfq_weights_tree_remove(bfqd, bfqq, root);
- }
+ if (prev_weight != new_weight && bfqq)
+ __bfq_weights_tree_remove(bfqd, bfqq);
entity->weight = new_weight;
/*
* Add the entity, if it is not a weight-raised queue,
* to the counter associated with its new weight.
*/
- if (prev_weight != new_weight && bfqq && bfqq->wr_coeff == 1) {
- /* If we get here, root has been initialized. */
- bfq_weights_tree_add(bfqd, bfqq, root);
- }
+ if (prev_weight != new_weight && bfqq && bfqq->wr_coeff == 1)
+ bfq_weights_tree_add(bfqd, bfqq);
new_st->wsum += entity->weight;
@@ -1697,8 +1692,7 @@ void bfq_add_bfqq_busy(struct bfq_data *bfqd, struct bfq_queue *bfqq)
if (!bfqq->dispatched)
if (bfqq->wr_coeff == 1)
- bfq_weights_tree_add(bfqd, bfqq,
- &bfqd->queue_weights_tree);
+ bfq_weights_tree_add(bfqd, bfqq);
if (bfqq->wr_coeff > 1)
bfqd->wr_busy_queues++;
--
2.31.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH -next v3 2/6] block, bfq: cleanup __bfq_weights_tree_remove()
2022-05-28 9:59 [PATCH -next v3 0/6] multiple cleanup patches for bfq Yu Kuai
2022-05-28 9:59 ` [PATCH -next v3 1/6] block, bfq: cleanup bfq_weights_tree add/remove apis Yu Kuai
@ 2022-05-28 9:59 ` Yu Kuai
2022-05-28 9:59 ` [PATCH -next v3 3/6] block, bfq: factor out code to update 'active_entities' Yu Kuai
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Yu Kuai @ 2022-05-28 9:59 UTC (permalink / raw)
To: paolo.valente, axboe, tj
Cc: linux-block, cgroups, linux-kernel, yukuai3, yi.zhang
It's the same with bfq_weights_tree_remove() now.
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
---
block/bfq-iosched.c | 13 +------------
block/bfq-iosched.h | 1 -
block/bfq-wf2q.c | 2 +-
3 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 2315cfbe46e7..8c7020f8cdf2 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -944,8 +944,7 @@ void bfq_weights_tree_add(struct bfq_data *bfqd, struct bfq_queue *bfqq)
* See the comments to the function bfq_weights_tree_add() for considerations
* about overhead.
*/
-void __bfq_weights_tree_remove(struct bfq_data *bfqd,
- struct bfq_queue *bfqq)
+void bfq_weights_tree_remove(struct bfq_data *bfqd, struct bfq_queue *bfqq)
{
struct rb_root_cached *root;
@@ -965,16 +964,6 @@ void __bfq_weights_tree_remove(struct bfq_data *bfqd,
bfq_put_queue(bfqq);
}
-/*
- * Invoke __bfq_weights_tree_remove on bfqq and decrement the number
- * of active groups for each queue's inactive parent entity.
- */
-void bfq_weights_tree_remove(struct bfq_data *bfqd,
- struct bfq_queue *bfqq)
-{
- __bfq_weights_tree_remove(bfqd, bfqq);
-}
-
/*
* Return expired entry, or NULL to just start from scratch in rbtree.
*/
diff --git a/block/bfq-iosched.h b/block/bfq-iosched.h
index 50c554134196..ecca2c0570ea 100644
--- a/block/bfq-iosched.h
+++ b/block/bfq-iosched.h
@@ -934,7 +934,6 @@ void bic_set_bfqq(struct bfq_io_cq *bic, struct bfq_queue *bfqq, bool is_sync);
struct bfq_data *bic_to_bfqd(struct bfq_io_cq *bic);
void bfq_pos_tree_add_move(struct bfq_data *bfqd, struct bfq_queue *bfqq);
void bfq_weights_tree_add(struct bfq_data *bfqd, struct bfq_queue *bfqq);
-void __bfq_weights_tree_remove(struct bfq_data *bfqd, struct bfq_queue *bfqq);
void bfq_weights_tree_remove(struct bfq_data *bfqd, struct bfq_queue *bfqq);
void bfq_bfqq_expire(struct bfq_data *bfqd, struct bfq_queue *bfqq,
bool compensate, enum bfqq_expiration reason);
diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c
index 03949c20494d..44905ed5175d 100644
--- a/block/bfq-wf2q.c
+++ b/block/bfq-wf2q.c
@@ -794,7 +794,7 @@ __bfq_entity_update_weight_prio(struct bfq_service_tree *old_st,
* there is a counter associated with the entity).
*/
if (prev_weight != new_weight && bfqq)
- __bfq_weights_tree_remove(bfqd, bfqq);
+ bfq_weights_tree_remove(bfqd, bfqq);
entity->weight = new_weight;
/*
* Add the entity, if it is not a weight-raised queue,
--
2.31.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH -next v3 3/6] block, bfq: factor out code to update 'active_entities'
2022-05-28 9:59 [PATCH -next v3 0/6] multiple cleanup patches for bfq Yu Kuai
2022-05-28 9:59 ` [PATCH -next v3 1/6] block, bfq: cleanup bfq_weights_tree add/remove apis Yu Kuai
2022-05-28 9:59 ` [PATCH -next v3 2/6] block, bfq: cleanup __bfq_weights_tree_remove() Yu Kuai
@ 2022-05-28 9:59 ` Yu Kuai
2022-05-28 9:59 ` [PATCH -next v3 4/6] block, bfq: don't declare 'bfqd' as type 'void *' in bfq_group Yu Kuai
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Yu Kuai @ 2022-05-28 9:59 UTC (permalink / raw)
To: paolo.valente, axboe, tj
Cc: linux-block, cgroups, linux-kernel, yukuai3, yi.zhang
Current code is a bit ugly and hard to read.
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
---
block/bfq-wf2q.c | 61 +++++++++++++++++++++++++-----------------------
1 file changed, 32 insertions(+), 29 deletions(-)
diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c
index 44905ed5175d..643e57ee3e64 100644
--- a/block/bfq-wf2q.c
+++ b/block/bfq-wf2q.c
@@ -232,6 +232,26 @@ static void bfq_dec_busy_queues(struct bfq_queue *bfqq)
bfqq->bfqd->num_groups_with_busy_queues--;
}
+static void bfq_inc_active_entities(struct bfq_entity *entity)
+{
+ struct bfq_sched_data *sd = entity->sched_data;
+ struct bfq_group *bfqg = container_of(sd, struct bfq_group, sched_data);
+ struct bfq_data *bfqd = (struct bfq_data *)bfqg->bfqd;
+
+ if (bfqg != bfqd->root_group)
+ bfqg->active_entities++;
+}
+
+static void bfq_dec_active_entities(struct bfq_entity *entity)
+{
+ struct bfq_sched_data *sd = entity->sched_data;
+ struct bfq_group *bfqg = container_of(sd, struct bfq_group, sched_data);
+ struct bfq_data *bfqd = (struct bfq_data *)bfqg->bfqd;
+
+ if (bfqg != bfqd->root_group)
+ bfqg->active_entities--;
+}
+
#else /* CONFIG_BFQ_GROUP_IOSCHED */
static bool bfq_update_parent_budget(struct bfq_entity *next_in_service)
@@ -254,6 +274,14 @@ static void bfq_dec_busy_queues(struct bfq_queue *bfqq)
bfqq->bfqd->busy_queues[bfqq->ioprio_class - 1]--;
}
+static void bfq_inc_active_entities(struct bfq_entity *entity)
+{
+}
+
+static void bfq_dec_active_entities(struct bfq_entity *entity)
+{
+}
+
#endif /* CONFIG_BFQ_GROUP_IOSCHED */
/*
@@ -480,11 +508,6 @@ static void bfq_active_insert(struct bfq_service_tree *st,
{
struct bfq_queue *bfqq = bfq_entity_to_bfqq(entity);
struct rb_node *node = &entity->rb_node;
-#ifdef CONFIG_BFQ_GROUP_IOSCHED
- struct bfq_sched_data *sd = NULL;
- struct bfq_group *bfqg = NULL;
- struct bfq_data *bfqd = NULL;
-#endif
bfq_insert(&st->active, entity);
@@ -495,17 +518,10 @@ static void bfq_active_insert(struct bfq_service_tree *st,
bfq_update_active_tree(node);
-#ifdef CONFIG_BFQ_GROUP_IOSCHED
- sd = entity->sched_data;
- bfqg = container_of(sd, struct bfq_group, sched_data);
- bfqd = (struct bfq_data *)bfqg->bfqd;
-#endif
if (bfqq)
list_add(&bfqq->bfqq_list, &bfqq->bfqd->active_list);
-#ifdef CONFIG_BFQ_GROUP_IOSCHED
- if (bfqg != bfqd->root_group)
- bfqg->active_entities++;
-#endif
+
+ bfq_inc_active_entities(entity);
}
/**
@@ -582,29 +598,16 @@ static void bfq_active_extract(struct bfq_service_tree *st,
{
struct bfq_queue *bfqq = bfq_entity_to_bfqq(entity);
struct rb_node *node;
-#ifdef CONFIG_BFQ_GROUP_IOSCHED
- struct bfq_sched_data *sd = NULL;
- struct bfq_group *bfqg = NULL;
- struct bfq_data *bfqd = NULL;
-#endif
node = bfq_find_deepest(&entity->rb_node);
bfq_extract(&st->active, entity);
if (node)
bfq_update_active_tree(node);
-
-#ifdef CONFIG_BFQ_GROUP_IOSCHED
- sd = entity->sched_data;
- bfqg = container_of(sd, struct bfq_group, sched_data);
- bfqd = (struct bfq_data *)bfqg->bfqd;
-#endif
if (bfqq)
list_del(&bfqq->bfqq_list);
-#ifdef CONFIG_BFQ_GROUP_IOSCHED
- if (bfqg != bfqd->root_group)
- bfqg->active_entities--;
-#endif
+
+ bfq_dec_active_entities(entity);
}
/**
--
2.31.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH -next v3 4/6] block, bfq: don't declare 'bfqd' as type 'void *' in bfq_group
2022-05-28 9:59 [PATCH -next v3 0/6] multiple cleanup patches for bfq Yu Kuai
` (2 preceding siblings ...)
2022-05-28 9:59 ` [PATCH -next v3 3/6] block, bfq: factor out code to update 'active_entities' Yu Kuai
@ 2022-05-28 9:59 ` Yu Kuai
2022-05-28 9:59 ` [PATCH -next v3 5/6] block, bfq: cleanup bfq_activate_requeue_entity() Yu Kuai
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Yu Kuai @ 2022-05-28 9:59 UTC (permalink / raw)
To: paolo.valente, axboe, tj
Cc: linux-block, cgroups, linux-kernel, yukuai3, yi.zhang
Prevent unnecessary format conversion for bfqg->bfqd in multiple
places.
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
---
block/bfq-cgroup.c | 2 +-
block/bfq-iosched.h | 2 +-
block/bfq-wf2q.c | 8 +++-----
3 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c
index 4d516879d9fa..b4e39ab4ad17 100644
--- a/block/bfq-cgroup.c
+++ b/block/bfq-cgroup.c
@@ -224,7 +224,7 @@ void bfqg_stats_update_io_add(struct bfq_group *bfqg, struct bfq_queue *bfqq,
{
blkg_rwstat_add(&bfqg->stats.queued, op, 1);
bfqg_stats_end_empty_time(&bfqg->stats);
- if (!(bfqq == ((struct bfq_data *)bfqg->bfqd)->in_service_queue))
+ if (!(bfqq == bfqg->bfqd->in_service_queue))
bfqg_stats_set_start_group_wait_time(bfqg, bfqq_group(bfqq));
}
diff --git a/block/bfq-iosched.h b/block/bfq-iosched.h
index ecca2c0570ea..c6109512503b 100644
--- a/block/bfq-iosched.h
+++ b/block/bfq-iosched.h
@@ -895,7 +895,7 @@ struct bfq_group {
struct bfq_entity entity;
struct bfq_sched_data sched_data;
- void *bfqd;
+ struct bfq_data *bfqd;
struct bfq_queue *async_bfqq[2][IOPRIO_NR_LEVELS];
struct bfq_queue *async_idle_bfqq;
diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c
index 643e57ee3e64..26ab9ba6e5a3 100644
--- a/block/bfq-wf2q.c
+++ b/block/bfq-wf2q.c
@@ -236,9 +236,8 @@ static void bfq_inc_active_entities(struct bfq_entity *entity)
{
struct bfq_sched_data *sd = entity->sched_data;
struct bfq_group *bfqg = container_of(sd, struct bfq_group, sched_data);
- struct bfq_data *bfqd = (struct bfq_data *)bfqg->bfqd;
- if (bfqg != bfqd->root_group)
+ if (bfqg != bfqg->bfqd->root_group)
bfqg->active_entities++;
}
@@ -246,9 +245,8 @@ static void bfq_dec_active_entities(struct bfq_entity *entity)
{
struct bfq_sched_data *sd = entity->sched_data;
struct bfq_group *bfqg = container_of(sd, struct bfq_group, sched_data);
- struct bfq_data *bfqd = (struct bfq_data *)bfqg->bfqd;
- if (bfqg != bfqd->root_group)
+ if (bfqg != bfqg->bfqd->root_group)
bfqg->active_entities--;
}
@@ -745,7 +743,7 @@ __bfq_entity_update_weight_prio(struct bfq_service_tree *old_st,
else {
sd = entity->my_sched_data;
bfqg = container_of(sd, struct bfq_group, sched_data);
- bfqd = (struct bfq_data *)bfqg->bfqd;
+ bfqd = bfqg->bfqd;
}
#endif
--
2.31.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH -next v3 5/6] block, bfq: cleanup bfq_activate_requeue_entity()
2022-05-28 9:59 [PATCH -next v3 0/6] multiple cleanup patches for bfq Yu Kuai
` (3 preceding siblings ...)
2022-05-28 9:59 ` [PATCH -next v3 4/6] block, bfq: don't declare 'bfqd' as type 'void *' in bfq_group Yu Kuai
@ 2022-05-28 9:59 ` Yu Kuai
2022-05-28 9:59 ` [PATCH -next v3 6/6] block, bfq: remove dead code for updating 'rq_in_driver' Yu Kuai
2022-05-30 7:34 ` [PATCH -next v3 0/6] multiple cleanup patches for bfq Paolo Valente
6 siblings, 0 replies; 8+ messages in thread
From: Yu Kuai @ 2022-05-28 9:59 UTC (permalink / raw)
To: paolo.valente, axboe, tj
Cc: linux-block, cgroups, linux-kernel, yukuai3, yi.zhang
Just make the code a litter cleaner by removing the unnecessary
variable 'sd'.
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
---
block/bfq-wf2q.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c
index 26ab9ba6e5a3..117d38ab0b30 100644
--- a/block/bfq-wf2q.c
+++ b/block/bfq-wf2q.c
@@ -1089,12 +1089,12 @@ static void __bfq_requeue_entity(struct bfq_entity *entity)
}
static void __bfq_activate_requeue_entity(struct bfq_entity *entity,
- struct bfq_sched_data *sd,
bool non_blocking_wait_rq)
{
struct bfq_service_tree *st = bfq_entity_service_tree(entity);
- if (sd->in_service_entity == entity || entity->tree == &st->active)
+ if (entity->sched_data->in_service_entity == entity ||
+ entity->tree == &st->active)
/*
* in service or already queued on the active tree,
* requeue or reposition
@@ -1126,14 +1126,10 @@ static void bfq_activate_requeue_entity(struct bfq_entity *entity,
bool non_blocking_wait_rq,
bool requeue, bool expiration)
{
- struct bfq_sched_data *sd;
-
for_each_entity(entity) {
- sd = entity->sched_data;
- __bfq_activate_requeue_entity(entity, sd, non_blocking_wait_rq);
-
- if (!bfq_update_next_in_service(sd, entity, expiration) &&
- !requeue)
+ __bfq_activate_requeue_entity(entity, non_blocking_wait_rq);
+ if (!bfq_update_next_in_service(entity->sched_data, entity,
+ expiration) && !requeue)
break;
}
}
--
2.31.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH -next v3 6/6] block, bfq: remove dead code for updating 'rq_in_driver'
2022-05-28 9:59 [PATCH -next v3 0/6] multiple cleanup patches for bfq Yu Kuai
` (4 preceding siblings ...)
2022-05-28 9:59 ` [PATCH -next v3 5/6] block, bfq: cleanup bfq_activate_requeue_entity() Yu Kuai
@ 2022-05-28 9:59 ` Yu Kuai
2022-05-30 7:34 ` [PATCH -next v3 0/6] multiple cleanup patches for bfq Paolo Valente
6 siblings, 0 replies; 8+ messages in thread
From: Yu Kuai @ 2022-05-28 9:59 UTC (permalink / raw)
To: paolo.valente, axboe, tj
Cc: linux-block, cgroups, linux-kernel, yukuai3, yi.zhang
Such code are not even compiled since they are inside marco "#if 0".
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
---
block/bfq-iosched.c | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 8c7020f8cdf2..79e6a60d61d8 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -2321,22 +2321,6 @@ static sector_t get_sdist(sector_t last_pos, struct request *rq)
return 0;
}
-#if 0 /* Still not clear if we can do without next two functions */
-static void bfq_activate_request(struct request_queue *q, struct request *rq)
-{
- struct bfq_data *bfqd = q->elevator->elevator_data;
-
- bfqd->rq_in_driver++;
-}
-
-static void bfq_deactivate_request(struct request_queue *q, struct request *rq)
-{
- struct bfq_data *bfqd = q->elevator->elevator_data;
-
- bfqd->rq_in_driver--;
-}
-#endif
-
static void bfq_remove_request(struct request_queue *q,
struct request *rq)
{
--
2.31.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH -next v3 0/6] multiple cleanup patches for bfq
2022-05-28 9:59 [PATCH -next v3 0/6] multiple cleanup patches for bfq Yu Kuai
` (5 preceding siblings ...)
2022-05-28 9:59 ` [PATCH -next v3 6/6] block, bfq: remove dead code for updating 'rq_in_driver' Yu Kuai
@ 2022-05-30 7:34 ` Paolo Valente
6 siblings, 0 replies; 8+ messages in thread
From: Paolo Valente @ 2022-05-30 7:34 UTC (permalink / raw)
To: Yu Kuai
Cc: Jens Axboe, Tejun Heo, linux-block, cgroups, linux-kernel, yi.zhang
> Il giorno 28 mag 2022, alle ore 11:59, Yu Kuai <yukuai3@huawei.com> ha scritto:
>
> Resend just in case v2 end up in spam (for Paolo).
>
> Changes in v2:
> - add missing blank line in patch 1.
> - remove patch 7,8, since they are wrong.
> - add reviewed-by tag
>
> There are no functional changes in this patchset, just some places
> that I think can be improved during code review.
>
Thank you for this cleanup!
Acked-by: Paolo Valente <paolo.valente@unimore.it>
> Previous version:
> v1: https://lore.kernel.org/all/20220514090522.1669270-1-yukuai3@huawei.com/
>
> Yu Kuai (6):
> block, bfq: cleanup bfq_weights_tree add/remove apis
> block, bfq: cleanup __bfq_weights_tree_remove()
> block, bfq: factor out code to update 'active_entities'
> block, bfq: don't declare 'bfqd' as type 'void *' in bfq_group
> block, bfq: cleanup bfq_activate_requeue_entity()
> block, bfq: remove dead code for updating 'rq_in_driver'
>
> block/bfq-cgroup.c | 2 +-
> block/bfq-iosched.c | 38 +++----------------
> block/bfq-iosched.h | 11 ++----
> block/bfq-wf2q.c | 91 ++++++++++++++++++++-------------------------
> 4 files changed, 51 insertions(+), 91 deletions(-)
>
> --
> 2.31.1
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-05-30 7:37 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-28 9:59 [PATCH -next v3 0/6] multiple cleanup patches for bfq Yu Kuai
2022-05-28 9:59 ` [PATCH -next v3 1/6] block, bfq: cleanup bfq_weights_tree add/remove apis Yu Kuai
2022-05-28 9:59 ` [PATCH -next v3 2/6] block, bfq: cleanup __bfq_weights_tree_remove() Yu Kuai
2022-05-28 9:59 ` [PATCH -next v3 3/6] block, bfq: factor out code to update 'active_entities' Yu Kuai
2022-05-28 9:59 ` [PATCH -next v3 4/6] block, bfq: don't declare 'bfqd' as type 'void *' in bfq_group Yu Kuai
2022-05-28 9:59 ` [PATCH -next v3 5/6] block, bfq: cleanup bfq_activate_requeue_entity() Yu Kuai
2022-05-28 9:59 ` [PATCH -next v3 6/6] block, bfq: remove dead code for updating 'rq_in_driver' Yu Kuai
2022-05-30 7:34 ` [PATCH -next v3 0/6] multiple cleanup patches for bfq Paolo Valente
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).