From: Tejun Heo <tj@kernel.org>
To: Peng Yu <yupeng0921@gmail.com>
Cc: "Christoph Hellwig" <hch@lst.de>,
"Sagi Grimberg" <sagi@grimberg.me>,
"Chaitanya Kulkarni" <kch@nvidia.com>,
"Keith Busch" <kbusch@kernel.org>,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Michal Koutný" <mkoutny@suse.com>,
"Josef Bacik" <josef@toxicpanda.com>,
"Jens Axboe" <axboe@kernel.dk>,
"Maurizio Lombardi" <mlombard@arkamax.eu>,
cgroups@vger.kernel.org, linux-block@vger.kernel.org,
linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v12] nvmet: add cgroup_id to charge namespace I/O to a cgroup
Date: Thu, 05 Nov 2026 08:49:20 -1000 [thread overview]
Message-ID: <95403f5dce741c515718b2fc7f5dcc64@kernel.org> (raw)
In-Reply-To: <20261104071600.470430-1-yupeng0921@gmail.com>
On Tue, Nov 03, 2026 at 11:16:00PM -0800, Peng Yu wrote:
> +/*
> + * A command of a namespace with a cgroup already runs from its own work
> + * item on the namespace's workqueue (see nvmet_blkcg_work()), so run the
> + * backend's work function right there; otherwise queue it on @wq.
> + */
> +static inline void nvmet_req_run_work(struct nvmet_req *req,
> + struct workqueue_struct *wq, struct work_struct *work,
> + work_func_t func)
> +{
> +#ifdef CONFIG_BLK_CGROUP
> + if (req->ns->blkcg_wq) {
> + func(work);
> + return;
> + }
> +#endif
> + INIT_WORK(work, func);
> + queue_work(wq, work);
> +}
With cgroup_id set, the file backend's Flush, DSM and Write Zeroes and
zone management now run synchronously in the command's blkcg_wq work
item and hold one of its max_active slots for the whole vfs_fsync(),
vfs_fallocate() or zone operation. This probably deserves at least a
comment. Can you add one?
From the cgroup and workqueue side,
Acked-by: Tejun Heo <tj@kernel.org>
Thanks.
--
tejun
prev parent reply other threads:[~2026-11-05 18:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 7:16 [PATCH v12] nvmet: add cgroup_id to charge namespace I/O to a cgroup Peng Yu
2026-11-05 18:49 ` Tejun Heo [this message]
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=95403f5dce741c515718b2fc7f5dcc64@kernel.org \
--to=tj@kernel.org \
--cc=axboe@kernel.dk \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=hch@lst.de \
--cc=josef@toxicpanda.com \
--cc=kbusch@kernel.org \
--cc=kch@nvidia.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=mkoutny@suse.com \
--cc=mlombard@arkamax.eu \
--cc=sagi@grimberg.me \
--cc=yupeng0921@gmail.com \
/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.