From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, Tejun Heo <tj@kernel.org>,
Christoph Hellwig <hch@lst.de>,
Bart Van Assche <bvanassche@acm.org>,
Ming Lei <ming.lei@redhat.com>
Subject: [PATCH 2/3] block: move initialization of q->blkg_list into blkcg_init_queue
Date: Fri, 11 Feb 2022 18:11:48 +0800 [thread overview]
Message-ID: <20220211101149.2368042-3-ming.lei@redhat.com> (raw)
In-Reply-To: <20220211101149.2368042-1-ming.lei@redhat.com>
q->blkg_list is only used by blkcg code, so move it into
blkcg_init_queue.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
block/blk-cgroup.c | 2 ++
block/blk-core.c | 3 ---
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 671debbae941..35deaceba1f0 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -1175,6 +1175,8 @@ int blkcg_init_queue(struct request_queue *q)
bool preloaded;
int ret;
+ INIT_LIST_HEAD(&q->blkg_list);
+
new_blkg = blkg_alloc(&blkcg_root, q, GFP_KERNEL);
if (!new_blkg)
return -ENOMEM;
diff --git a/block/blk-core.c b/block/blk-core.c
index be8812f5489d..ff972b968f25 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -476,9 +476,6 @@ struct request_queue *blk_alloc_queue(int node_id, bool alloc_srcu)
timer_setup(&q->timeout, blk_rq_timed_out_timer, 0);
INIT_WORK(&q->timeout_work, blk_timeout_work);
INIT_LIST_HEAD(&q->icq_list);
-#ifdef CONFIG_BLK_CGROUP
- INIT_LIST_HEAD(&q->blkg_list);
-#endif
kobject_init(&q->kobj, &blk_queue_ktype);
--
2.31.1
next prev parent reply other threads:[~2022-02-11 10:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-11 10:11 [PATCH 0/3] block: cleanup cgroup Ming Lei
2022-02-11 10:11 ` [PATCH 1/3] block: remove THROTL_IOPS_MAX Ming Lei
2022-02-11 15:56 ` Christoph Hellwig
2022-02-11 10:11 ` Ming Lei [this message]
2022-02-11 10:11 ` [PATCH 3/3] block: partition include/linux/blk-cgroup.h Ming Lei
2022-02-11 15:57 ` Christoph Hellwig
2022-02-11 17:02 ` [PATCH 0/3] block: cleanup cgroup Jens Axboe
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=20220211101149.2368042-3-ming.lei@redhat.com \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.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 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).