From: "Michal Koutný" <mkoutny@suse.com>
To: Shaojie Sun <sunshaojie@kylinos.cn>
Cc: Tejun Heo <tj@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
Shuah Khan <shuah@kernel.org>,
cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] selftests/cgroup: Add a test for the /proc/self/cgroup namespace view
Date: Wed, 23 Sep 2026 19:38:32 +0200 [thread overview]
Message-ID: <arP_HOr98HkTC-mK@localhost.localdomain> (raw)
In-Reply-To: <20260916111445.245788-1-sunshaojie@kylinos.cn>
[-- Attachment #1: Type: text/plain, Size: 1857 bytes --]
Hello.
On Wed, Sep 16, 2026 at 07:14:45PM +0800, Shaojie Sun <sunshaojie@kylinos.cn> wrote:
> ---
> RFC. This adds the missing selftest coverage for how /proc/$PID/cgroup is
> rendered for cgroup namespaces: the behavior is documented in
> Documentation/admin-guide/cgroup-v2.rst (section "Namespace"), but nothing
> in tools/testing/selftests exercises it.
What lead you to consider this as the missing coverage? (Are you using
some kcov reports or just the docs?)
What reasons do you see for this to break?
>
> Two points I would like feedback on before asking for a merge:
>
> - The third case, a process moved into a sibling cgroup of its namespace
> root, needs the parent and the child to synchronize, which is about a
> third of the file. Letting the child migrate itself after unsharing
> would remove most of that code, but with the nsdelegate mount option
> (which systemd sets by default) cgroup_procs_write_permission()
> rejects the migration with -ENOENT, so the test could only skip on
> exactly the setups where the behavior matters. Keep the coverage and
> the synchronization, prefer the smaller test, or split the file into a
> basic-view patch and a boundary patch?
Looking at the sibling cgns is not so common, hence the test isn't
easily implementable. I prefer the smaller test w/out this case. (If the
child checked /proc/<other-pid>/cgroup, perhaps it could be simpler but
some synchronization is likely unavoidable.)
>
> - I kept the ksft_* style with a tests[] table which the other tests in
> this directory use. If new tests should use kselftest_harness.h
> instead, I can switch.
I'd like to gradually move to the harness, i.e. potential new code could
use that.
> This is an RFC, not a merge request yet.
Thank you
Michal
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 265 bytes --]
prev parent reply other threads:[~2026-09-23 17:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 11:14 Shaojie Sun
2026-09-23 17:38 ` Michal Koutný [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=arP_HOr98HkTC-mK@localhost.localdomain \
--to=mkoutny@suse.com \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=sunshaojie@kylinos.cn \
--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
all inboxes | Powered by JetHome®