linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH -next v4 1/5] block, bfq: remove set but not used variable in __bfq_entity_update_weight_prio
  2022-11-02  2:25 ` [PATCH -next v4 1/5] block, bfq: remove set but not used variable in __bfq_entity_update_weight_prio Yu Kuai
@ 2022-11-02  2:09   ` Jens Axboe
  2022-11-02  2:11     ` Jens Axboe
  0 siblings, 1 reply; 11+ messages in thread
From: Jens Axboe @ 2022-11-02  2:09 UTC (permalink / raw)
  To: Yu Kuai, jack, paolo.valente
  Cc: cgroups, linux-block, linux-kernel, yukuai3, yi.zhang

On 11/1/22 8:25 PM, Yu Kuai wrote:
> From: Yu Kuai <yukuai3@huawei.com>
> 
> After the patch "block, bfq: cleanup bfq_weights_tree add/remove apis"),
> the local variable 'bfqd' is not used anymore, thus remove it.

Please add a Fixes tag.

-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH -next v4 1/5] block, bfq: remove set but not used variable in __bfq_entity_update_weight_prio
  2022-11-02  2:09   ` Jens Axboe
@ 2022-11-02  2:11     ` Jens Axboe
  2022-11-02  2:18       ` Yu Kuai
  0 siblings, 1 reply; 11+ messages in thread
From: Jens Axboe @ 2022-11-02  2:11 UTC (permalink / raw)
  To: Yu Kuai, jack, paolo.valente
  Cc: cgroups, linux-block, linux-kernel, yukuai3, yi.zhang

On 11/1/22 8:09 PM, Jens Axboe wrote:
> On 11/1/22 8:25 PM, Yu Kuai wrote:
>> From: Yu Kuai <yukuai3@huawei.com>
>>
>> After the patch "block, bfq: cleanup bfq_weights_tree add/remove apis"),
>> the local variable 'bfqd' is not used anymore, thus remove it.
> 
> Please add a Fixes tag.

Looks like the rest were good to go, so I added it myself.

-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH -next v4 0/5] multiple cleanup patches for bfqd
  2022-11-02  2:25 [PATCH -next v4 0/5] multiple cleanup patches for bfqd Yu Kuai
@ 2022-11-02  2:11 ` Jens Axboe
  2022-11-02  2:25 ` [PATCH -next v4 1/5] block, bfq: remove set but not used variable in __bfq_entity_update_weight_prio Yu Kuai
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Jens Axboe @ 2022-11-02  2:11 UTC (permalink / raw)
  To: jack, Yu Kuai, paolo.valente
  Cc: linux-block, linux-kernel, yi.zhang, cgroups, yukuai3

On Wed, 2 Nov 2022 10:25:37 +0800, Yu Kuai wrote:
> From: Yu Kuai <yukuai3@huawei.com>
> 
> Changes in v4:
>  - move first two patches from v3 into another thread.
>  - add patch 1
> 
> Changes in v3:
>  - resend v2 with new mail address
> 
> [...]

Applied, thanks!

[1/5] block, bfq: remove set but not used variable in __bfq_entity_update_weight_prio
      commit: 060d9217d356a28e1bcfd2df0c8bf59aa24a12ce
[2/5] block, bfq: factor out code to update 'active_entities'
      commit: e5c63eb4b59f9fb9b28e29d605a4dabbeff7772e
[3/5] block, bfq: cleanup bfq_activate_requeue_entity()
      commit: f6fd119b1ae2c4f794dffc87421cf4ce2414401e
[4/5] block, bfq: remove dead code for updating 'rq_in_driver'
      commit: 918fdea3884ca8de93bd0e8ad02545eb8e3695d6
[5/5] block, bfq: don't declare 'bfqd' as type 'void *' in bfq_group
      commit: aa625117d6f67e33fab280358855fdd332bb20ab

Best regards,
-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH -next v4 1/5] block, bfq: remove set but not used variable in __bfq_entity_update_weight_prio
  2022-11-02  2:11     ` Jens Axboe
@ 2022-11-02  2:18       ` Yu Kuai
  2022-11-02  2:24         ` Jens Axboe
  0 siblings, 1 reply; 11+ messages in thread
From: Yu Kuai @ 2022-11-02  2:18 UTC (permalink / raw)
  To: Jens Axboe, Yu Kuai, jack, paolo.valente
  Cc: cgroups, linux-block, linux-kernel, yi.zhang, yukuai (C)

Hi,

在 2022/11/02 10:11, Jens Axboe 写道:
> On 11/1/22 8:09 PM, Jens Axboe wrote:
>> On 11/1/22 8:25 PM, Yu Kuai wrote:
>>> From: Yu Kuai <yukuai3@huawei.com>
>>>
>>> After the patch "block, bfq: cleanup bfq_weights_tree add/remove apis"),
>>> the local variable 'bfqd' is not used anymore, thus remove it.
>>
>> Please add a Fixes tag.
> 
> Looks like the rest were good to go, so I added it myself.

Thanks for helping out. I'm not sure which commit id to use since the
fixed patch is not in linux-next yet, does the commit id stay the same
when the patch applied from for-6.2 to next ?

Thanks,
Kuai
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH -next v4 1/5] block, bfq: remove set but not used variable in __bfq_entity_update_weight_prio
  2022-11-02  2:18       ` Yu Kuai
@ 2022-11-02  2:24         ` Jens Axboe
  0 siblings, 0 replies; 11+ messages in thread
From: Jens Axboe @ 2022-11-02  2:24 UTC (permalink / raw)
  To: Yu Kuai, jack, paolo.valente
  Cc: cgroups, linux-block, linux-kernel, yi.zhang, yukuai (C)

On 11/1/22 8:18 PM, Yu Kuai wrote:
> Hi,
> 
> 在 2022/11/02 10:11, Jens Axboe 写道:
>> On 11/1/22 8:09 PM, Jens Axboe wrote:
>>> On 11/1/22 8:25 PM, Yu Kuai wrote:
>>>> From: Yu Kuai <yukuai3@huawei.com>
>>>>
>>>> After the patch "block, bfq: cleanup bfq_weights_tree add/remove apis"),
>>>> the local variable 'bfqd' is not used anymore, thus remove it.
>>>
>>> Please add a Fixes tag.
>>
>> Looks like the rest were good to go, so I added it myself.
> 
> Thanks for helping out. I'm not sure which commit id to use since the
> fixed patch is not in linux-next yet, does the commit id stay the same
> when the patch applied from for-6.2 to next ?

linux-next shas are not stable, but since you're sending this to the
linux-block list and against the block tree, that's obviously where
you'd find that commit.

-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH -next v4 0/5] multiple cleanup patches for bfqd
@ 2022-11-02  2:25 Yu Kuai
  2022-11-02  2:11 ` Jens Axboe
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Yu Kuai @ 2022-11-02  2:25 UTC (permalink / raw)
  To: jack, axboe, paolo.valente
  Cc: cgroups, linux-block, linux-kernel, yukuai3, yukuai1, yi.zhang

From: Yu Kuai <yukuai3@huawei.com>

Changes in v4:
 - move first two patches from v3 into another thread.
 - add patch 1

Changes in v3:
 - resend v2 with new mail address

Changes in v2:
 - add missing blank line in patch 1.
 - remove patch 7,8, since they are wrong.
 - add reviewed-by tag

Yu Kuai (5):
  block, bfq: remove set but not used variable in
    __bfq_entity_update_weight_prio
  block, bfq: factor out code to update 'active_entities'
  block, bfq: cleanup bfq_activate_requeue_entity()
  block, bfq: remove dead code for updating 'rq_in_driver'
  block, bfq: don't declare 'bfqd' as type 'void *' in bfq_group

 block/bfq-cgroup.c  |  2 +-
 block/bfq-iosched.c | 16 ---------
 block/bfq-iosched.h |  2 +-
 block/bfq-wf2q.c    | 88 ++++++++++++++++++---------------------------
 4 files changed, 37 insertions(+), 71 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH -next v4 1/5] block, bfq: remove set but not used variable in __bfq_entity_update_weight_prio
  2022-11-02  2:25 [PATCH -next v4 0/5] multiple cleanup patches for bfqd Yu Kuai
  2022-11-02  2:11 ` Jens Axboe
@ 2022-11-02  2:25 ` Yu Kuai
  2022-11-02  2:09   ` Jens Axboe
  2022-11-02  2:25 ` [PATCH -next v4 2/5] block, bfq: factor out code to update 'active_entities' Yu Kuai
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Yu Kuai @ 2022-11-02  2:25 UTC (permalink / raw)
  To: jack, axboe, paolo.valente
  Cc: cgroups, linux-block, linux-kernel, yukuai3, yukuai1, yi.zhang

From: Yu Kuai <yukuai3@huawei.com>

After the patch "block, bfq: cleanup bfq_weights_tree add/remove apis"),
the local variable 'bfqd' is not used anymore, thus remove it.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 block/bfq-wf2q.c | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c
index 5a02cb94d86e..2faa29fcb1e9 100644
--- a/block/bfq-wf2q.c
+++ b/block/bfq-wf2q.c
@@ -706,21 +706,6 @@ __bfq_entity_update_weight_prio(struct bfq_service_tree *old_st,
 	if (entity->prio_changed) {
 		struct bfq_queue *bfqq = bfq_entity_to_bfqq(entity);
 		unsigned int prev_weight, new_weight;
-		struct bfq_data *bfqd = NULL;
-#ifdef CONFIG_BFQ_GROUP_IOSCHED
-		struct bfq_sched_data *sd;
-		struct bfq_group *bfqg;
-#endif
-
-		if (bfqq)
-			bfqd = bfqq->bfqd;
-#ifdef CONFIG_BFQ_GROUP_IOSCHED
-		else {
-			sd = entity->my_sched_data;
-			bfqg = container_of(sd, struct bfq_group, sched_data);
-			bfqd = (struct bfq_data *)bfqg->bfqd;
-		}
-#endif
 
 		/* Matches the smp_wmb() in bfq_group_set_weight. */
 		smp_rmb();
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH -next v4 2/5] block, bfq: factor out code to update 'active_entities'
  2022-11-02  2:25 [PATCH -next v4 0/5] multiple cleanup patches for bfqd Yu Kuai
  2022-11-02  2:11 ` Jens Axboe
  2022-11-02  2:25 ` [PATCH -next v4 1/5] block, bfq: remove set but not used variable in __bfq_entity_update_weight_prio Yu Kuai
@ 2022-11-02  2:25 ` Yu Kuai
  2022-11-02  2:25 ` [PATCH -next v4 3/5] block, bfq: cleanup bfq_activate_requeue_entity() Yu Kuai
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Yu Kuai @ 2022-11-02  2:25 UTC (permalink / raw)
  To: jack, axboe, paolo.valente
  Cc: cgroups, linux-block, linux-kernel, yukuai3, yukuai1, yi.zhang

From: Yu Kuai <yukuai3@huawei.com>

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>
Acked-by: Paolo Valente <paolo.valente@unimore.it>
---
 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 2faa29fcb1e9..a908aa3eb0ab 100644
--- a/block/bfq-wf2q.c
+++ b/block/bfq-wf2q.c
@@ -218,6 +218,26 @@ static bool bfq_no_longer_next_in_service(struct bfq_entity *entity)
 	return false;
 }
 
+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)
@@ -230,6 +250,14 @@ static bool bfq_no_longer_next_in_service(struct bfq_entity *entity)
 	return true;
 }
 
+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 */
 
 /*
@@ -456,11 +484,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);
 
@@ -471,17 +494,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);
 }
 
 /**
@@ -558,29 +574,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] 11+ messages in thread

* [PATCH -next v4 3/5] block, bfq: cleanup bfq_activate_requeue_entity()
  2022-11-02  2:25 [PATCH -next v4 0/5] multiple cleanup patches for bfqd Yu Kuai
                   ` (2 preceding siblings ...)
  2022-11-02  2:25 ` [PATCH -next v4 2/5] block, bfq: factor out code to update 'active_entities' Yu Kuai
@ 2022-11-02  2:25 ` Yu Kuai
  2022-11-02  2:25 ` [PATCH -next v4 4/5] block, bfq: remove dead code for updating 'rq_in_driver' Yu Kuai
  2022-11-02  2:25 ` [PATCH -next v4 5/5] block, bfq: don't declare 'bfqd' as type 'void *' in bfq_group Yu Kuai
  5 siblings, 0 replies; 11+ messages in thread
From: Yu Kuai @ 2022-11-02  2:25 UTC (permalink / raw)
  To: jack, axboe, paolo.valente
  Cc: cgroups, linux-block, linux-kernel, yukuai3, yukuai1, yi.zhang

From: Yu Kuai <yukuai3@huawei.com>

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>
Acked-by: Paolo Valente <paolo.valente@unimore.it>
---
 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 a908aa3eb0ab..4d4b84e7bf3e 100644
--- a/block/bfq-wf2q.c
+++ b/block/bfq-wf2q.c
@@ -1052,12 +1052,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
@@ -1089,14 +1089,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] 11+ messages in thread

* [PATCH -next v4 4/5] block, bfq: remove dead code for updating 'rq_in_driver'
  2022-11-02  2:25 [PATCH -next v4 0/5] multiple cleanup patches for bfqd Yu Kuai
                   ` (3 preceding siblings ...)
  2022-11-02  2:25 ` [PATCH -next v4 3/5] block, bfq: cleanup bfq_activate_requeue_entity() Yu Kuai
@ 2022-11-02  2:25 ` Yu Kuai
  2022-11-02  2:25 ` [PATCH -next v4 5/5] block, bfq: don't declare 'bfqd' as type 'void *' in bfq_group Yu Kuai
  5 siblings, 0 replies; 11+ messages in thread
From: Yu Kuai @ 2022-11-02  2:25 UTC (permalink / raw)
  To: jack, axboe, paolo.valente
  Cc: cgroups, linux-block, linux-kernel, yukuai3, yukuai1, yi.zhang

From: Yu Kuai <yukuai3@huawei.com>

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>
Acked-by: Paolo Valente <paolo.valente@unimore.it>
---
 block/bfq-iosched.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 42aa5fc7f17b..2381cf220ba2 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] 11+ messages in thread

* [PATCH -next v4 5/5] block, bfq: don't declare 'bfqd' as type 'void *' in bfq_group
  2022-11-02  2:25 [PATCH -next v4 0/5] multiple cleanup patches for bfqd Yu Kuai
                   ` (4 preceding siblings ...)
  2022-11-02  2:25 ` [PATCH -next v4 4/5] block, bfq: remove dead code for updating 'rq_in_driver' Yu Kuai
@ 2022-11-02  2:25 ` Yu Kuai
  5 siblings, 0 replies; 11+ messages in thread
From: Yu Kuai @ 2022-11-02  2:25 UTC (permalink / raw)
  To: jack, axboe, paolo.valente
  Cc: cgroups, linux-block, linux-kernel, yukuai3, yukuai1, yi.zhang

From: Yu Kuai <yukuai3@huawei.com>

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>
Acked-by: Paolo Valente <paolo.valente@unimore.it>
---
 block/bfq-cgroup.c  | 2 +-
 block/bfq-iosched.h | 2 +-
 block/bfq-wf2q.c    | 6 ++----
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c
index 4c37398e0b99..d57872cc05ed 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, opf, 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 76363841d8ff..9fa89577322d 100644
--- a/block/bfq-iosched.h
+++ b/block/bfq-iosched.h
@@ -931,7 +931,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 4d4b84e7bf3e..b02b53658ed4 100644
--- a/block/bfq-wf2q.c
+++ b/block/bfq-wf2q.c
@@ -222,9 +222,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++;
 }
 
@@ -232,9 +231,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--;
 }
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-11-02  2:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-02  2:25 [PATCH -next v4 0/5] multiple cleanup patches for bfqd Yu Kuai
2022-11-02  2:11 ` Jens Axboe
2022-11-02  2:25 ` [PATCH -next v4 1/5] block, bfq: remove set but not used variable in __bfq_entity_update_weight_prio Yu Kuai
2022-11-02  2:09   ` Jens Axboe
2022-11-02  2:11     ` Jens Axboe
2022-11-02  2:18       ` Yu Kuai
2022-11-02  2:24         ` Jens Axboe
2022-11-02  2:25 ` [PATCH -next v4 2/5] block, bfq: factor out code to update 'active_entities' Yu Kuai
2022-11-02  2:25 ` [PATCH -next v4 3/5] block, bfq: cleanup bfq_activate_requeue_entity() Yu Kuai
2022-11-02  2:25 ` [PATCH -next v4 4/5] block, bfq: remove dead code for updating 'rq_in_driver' Yu Kuai
2022-11-02  2:25 ` [PATCH -next v4 5/5] block, bfq: don't declare 'bfqd' as type 'void *' in bfq_group Yu Kuai

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).