mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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>,
	"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 v6 0/3] nvmet: add cgroup_id to charge namespace I/O to a cgroup
Date: Mon, 28 Sep 2026 08:24:41 -1000	[thread overview]
Message-ID: <dfe81db2d9bc6cc6b17fc1f440af184b@kernel.org> (raw)
In-Reply-To: <20260928061417.1574676-1-yupeng0921@gmail.com>

Hello, Peng.

The following is a Claude-generated review.

On Sun, Sep 27, 2026 at 11:14:14PM -0700, Peng Yu wrote:
> Scenario:
> * Create multiple nvmet subsystems/namespaces.
> * The namespaces are backed by different LVM logical volumes.
> * Some of the logical volumes share the same physical volumes.
> * The subsystems are exported to different users.
> * We should provide each user a specific iops/bps quota, thus a noisy
>   neighbor won't impact the performance of other logical volumes.

- 1/3: Can you explain why in the description? Per-IO users such as nvmet
  need the lookup to be O(1) instead of walking up the hierarchy.

  rebind_subsystems() moves root csses between hierarchies without
  updating e_css[]. This is fine as a root cgroup's e_css[] always points
  to init_css_set.subsys[], but that isn't obvious. Maybe note it in a
  comment in init_cgroup_root()?

  Can you also add a comment on the new e_css[] field like the fields
  around it? It should say what it points to (the css of the nearest
  ancestor including self which has the subsystem enabled) and that it's
  updated under cgroup_mutex and read under RCU.

- 2/3: This isn't needed with the change suggested for 3/3 below.
  Otherwise, cgroup_e_css() now has the same shape as cgroup_css() and
  could be a static inline in include/linux/cgroup.h instead of an export.

- 3/3: nvmet_blkcg_set_bio() calls bio_associate_blkg_from_css() under
  rcu_read_lock(). If the blkg doesn't exist yet, it grabs queue_lock
  inside the RCU section. f928145cbcb5 ("mm/page_io: don't nest queue_lock
  under rcu in bio_associate_blkg_from_page()") removed the same nesting
  from mm/page_io.c to prepare for protecting blkcg with blkcg_mutex
  instead of queue_lock. How about the following instead?

	css = cgroup_get_e_css(ns->cgrp, &io_cgrp_subsys);
	bio_associate_blkg_from_css(bio, css);
	css_put(css);

  With 1/3, this is O(1) too and it skips csses which are going offline
  the same way nvmet_blkcg_begin() does. It also only uses symbols which
  are already exported.

Thanks.

--
tejun

      parent reply	other threads:[~2026-09-28 18:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28  6:14 Peng Yu
2026-09-28  6:14 ` [PATCH v6 1/3] cgroup: track the effective css in each cgroup Peng Yu
2026-09-28  6:14 ` [PATCH v6 2/3] cgroup: export cgroup_e_css() Peng Yu
2026-09-28  6:14 ` [PATCH v6 3/3] nvmet: add cgroup_id to charge namespace I/O to a cgroup Peng Yu
2026-09-28 18:24 ` 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=dfe81db2d9bc6cc6b17fc1f440af184b@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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®