Re: [PATCH v3] nvmet: add cgroup_path to charge namespace I/O to a cgroup
From: Tejun Heo
Date: Wed Sep 23 2026 - 12:44:27 EST
Hello, Peng.
On Wed, 23 Sep 2026 08:26:53 -0700, Peng Yu wrote:
> Implementation:
> * Add a `cgroup_path` attribute under the nvmet namespace folder, e.g.:
> /sys/kernel/config/nvmet/subsystems/nqn.2026-09.io.test01:bdev/namespaces/1/cgroup_path
Maybe take a cgroup ID instead of a path? Userspace can read it as the
inode number of the cgroup directory, and cgroup_get_from_id() resolves it
at enable time the same way cgroup_get_from_path() does now. The attribute
then becomes a u64, which drops the string allocation and freeing along
with the path validation. IDs are also never reused, while a path can
later name a different cgroup created at the same location.
Thanks.
--
tejun