All of lore.kernel.org
 help / color / mirror / Atom feed
From: brookxu <brookxu.cn@gmail.com>
To: paolo.valente@linaro.org, axboe@kernel.dk, tj@kernel.org
Cc: linux-block@vger.kernel.org, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [RFC PATCH v2 02/11] bfq: convert the type of bfq_group.bfqd to bfq_data*
Date: Fri, 12 Mar 2021 19:08:36 +0800	[thread overview]
Message-ID: <856a594d70b9a43b911285ff192d892d664001b0.1615527324.git.brookxu@tencent.com> (raw)
In-Reply-To: <cover.1615517202.git.brookxu@tencent.com>
In-Reply-To: <cover.1615527324.git.brookxu@tencent.com>

From: Chunguang Xu <brookxu@tencent.com>

Setting bfq_group.bfqd to void* type does not seem to make much sense.
This will cause unnecessary type conversion. Perhaps it would be better
to change it to bfq_data* type.

Signed-off-by: Chunguang Xu <brookxu@tencent.com>
---
 block/bfq-cgroup.c  | 2 +-
 block/bfq-iosched.h | 2 +-
 block/bfq-wf2q.c    | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c
index a5f544acaa61..50d06c760194 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 a6f98e9e14b5..28d85903cf66 100644
--- a/block/bfq-iosched.h
+++ b/block/bfq-iosched.h
@@ -914,7 +914,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_BE_NR];
 	struct bfq_queue *async_idle_bfqq;
diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c
index 5ff0028920a2..276f225f9c6e 100644
--- a/block/bfq-wf2q.c
+++ b/block/bfq-wf2q.c
@@ -498,7 +498,7 @@ static void bfq_active_insert(struct bfq_service_tree *st,
 #ifdef CONFIG_BFQ_GROUP_IOSCHED
 	sd = entity->sched_data;
 	bfqg = container_of(sd, struct bfq_group, sched_data);
-	bfqd = (struct bfq_data *)bfqg->bfqd;
+	bfqd = bfqg->bfqd;
 #endif
 	if (bfqq)
 		list_add(&bfqq->bfqq_list, &bfqq->bfqd->active_list);
@@ -597,7 +597,7 @@ static void bfq_active_extract(struct bfq_service_tree *st,
 #ifdef CONFIG_BFQ_GROUP_IOSCHED
 	sd = entity->sched_data;
 	bfqg = container_of(sd, struct bfq_group, sched_data);
-	bfqd = (struct bfq_data *)bfqg->bfqd;
+	bfqd = bfqg->bfqd;
 #endif
 	if (bfqq)
 		list_del(&bfqq->bfqq_list);
@@ -743,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.30.0


  parent reply	other threads:[~2021-03-12 11:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12 11:08 [RFC PATCH v2 00/11] bfq: introduce bfq.ioprio for cgroup brookxu
     [not found] ` <cover.1615527324.git.brookxu@tencent.com>
2021-03-12 11:08   ` [RFC PATCH v2 01/11] bfq: introduce bfq_entity_to_bfqg helper method brookxu
2021-03-12 11:08   ` brookxu [this message]
2021-03-12 11:08   ` [RFC PATCH v2 03/11] bfq: introduce bfq.ioprio for cgroup brookxu
2021-03-12 11:08     ` brookxu
2021-03-12 11:08   ` [RFC PATCH v2 04/11] bfq: limit the IO depth of idle_class to 1 brookxu
2021-03-12 11:08     ` brookxu
2021-03-12 11:08   ` [RFC PATCH v2 05/11] bfq: keep the minimun bandwidth for be_class brookxu
2021-03-12 11:08   ` [RFC PATCH v2 06/11] bfq: expire other class if CLASS_RT is waiting brookxu
2021-03-12 11:08     ` brookxu
2021-03-12 11:08   ` [RFC PATCH v2 07/11] bfq: optimse IO injection for CLASS_RT brookxu
2021-03-12 11:08     ` brookxu
2021-03-12 11:08   ` [RFC PATCH v2 08/11] bfq: disallow idle if CLASS_RT waiting for service brookxu
2021-03-12 11:08     ` brookxu
2021-03-12 11:08   ` [RFC PATCH v2 09/11] bfq: disallow merge CLASS_RT with other class brookxu
2021-03-12 11:08     ` brookxu
2021-03-12 11:08   ` [RFC PATCH v2 10/11] bfq: remove unnecessary initialization logic brookxu
2021-03-12 11:08     ` brookxu
2021-03-12 11:08   ` [RFC PATCH v2 11/11] bfq: optimize the calculation of bfq_weight_to_ioprio() brookxu
2021-03-21 11:04 ` [RFC PATCH v2 00/11] bfq: introduce bfq.ioprio for cgroup Paolo Valente
2021-03-22  5:44   ` brookxu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=856a594d70b9a43b911285ff192d892d664001b0.1615527324.git.brookxu@tencent.com \
    --to=brookxu.cn@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=cgroups@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paolo.valente@linaro.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.