From: sashiko-bot@kernel.org
To: "Shakeel Butt" <shakeel.butt@linux.dev>, "Tejun Heo" <tj@kernel.org>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Michal Koutny" <mkoutny@suse.com>,
"Michal Hocko" <mhocko@kernel.org>,
"Roman Gushchin" <roman.gushchin@linux.dev>,
"Christian Brauner" <brauner@kernel.org>,
"Oleg Nesterov" <oleg@redhat.com>,
"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
"Suren Baghdasaryan" <surenb@google.com>,
"T . J . Mercier" <tjmercier@google.com>,
"Usama Arif" <usama.arif@linux.dev>,
"Meta kernel team" <kernel-team@meta.com>,
linux-mm@kvack.org
Subject: Re: [PATCH v3 07/12] selftests/cgroup: test cgroup.procs reads across a failed migration
Date: Sat, 05 Dec 2026 18:42:22 +0000 [thread overview]
Message-ID: <sashiko-outbox-251804@kernel.org> (raw)
In-Reply-To: <20261204184041.1489976-8-shakeel.butt@linux.dev>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Low] selftests/cgroup: silent skips in
test_cgcore_procs_failed_migration()
- [Low] selftests/cgroup: 256-byte cpus buffer truncates
cpuset.cpus.effective
--
commit c61d3720c208c370f51165c85f1c8abc0144a52d
Author: Shakeel Butt <shakeel.butt@linux.dev>
selftests/cgroup: test cgroup.procs reads across a failed migration
This commit adds a cgroup selftest that reads cgroup.procs across a failed
cpuset migration and verifies that the target process is still listed.
> diff --git a/tools/testing/selftests/cgroup/test_core.c b/tools/testing/selftests/cgroup/test_core.c
> index 53592bf309fac..01c268672d6dd 100644
> --- a/tools/testing/selftests/cgroup/test_core.c
> +++ b/tools/testing/selftests/cgroup/test_core.c
> @@ -739,6 +740,158 @@ static int test_cgcore_thread_migration(const char *root)
[ ... ]
> +static int test_cgcore_procs_failed_migration(const char *root)
> +{
> + char *parent = NULL, *full = NULL, *empty = NULL, *cg = NULL;
> + char cpus[256], cpu[16], buf[4096];
[ ... ]
> + if (cg_read(root, "cpuset.cpus.effective", cpus, sizeof(cpus)))
> + goto cleanup;
> + last = cpulist_last(cpus);
[Severity: Low]
Can cpus[256] truncate cpuset.cpus.effective on large systems?
read_text() stops at max_len - 1 bytes without reporting truncation, so
cg_read() still returns 0. On a 160+ CPU host with fragmented online
CPUs, cpus can be cut mid-number, causing cpulist_last() to parse an
offline CPU ID and unnecessarily skip the test.
Reusing the 4096-byte buf and checking for a trailing newline would avoid
parsing a truncated CPU number.
[ ... ]
> + /* Without a failing migration there is nothing to test. */
> + if (cg_enter(empty, pids[2]) != -ENOSPC) {
> + ret = KSFT_SKIP;
> + goto cleanup;
> + }
[Severity: Low]
Should the KSFT_SKIP paths in test_cgcore_procs_failed_migration() log a
skip reason with ksft_print_msg()?
main() only prints the test name via ksft_test_result_skip(), so skipping
on a cgroup v1 named hierarchy, during cpuset partition setup, or on this
probe migration check leaves no indication in the test output of which
prerequisite was missing.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204184041.1489976-1-shakeel.butt@linux.dev?part=7
next prev parent reply other threads:[~2026-12-05 18:42 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 18:40 [PATCH v3 00/12] cgroup: don't hold cgroup_mutex for cgroup.kill and cgroup.freeze Shakeel Butt
2026-12-04 18:40 ` [PATCH v3 01/12] cgroup: don't lose a task in css_task_iter when a migration fails Shakeel Butt
2026-12-05 7:54 ` Tejun Heo
2026-12-04 18:40 ` [PATCH v3 02/12] cgroup: kill a child forked while cgroup.kill runs Shakeel Butt
2026-12-04 18:40 ` [PATCH v3 03/12] cgroup: refuse cgroup.kill below a threaded cgroup Shakeel Butt
2026-12-04 18:40 ` [PATCH v3 04/12] cgroup/freezer: check own tasks and descendants for the frozen state Shakeel Butt
2026-12-04 18:40 ` [PATCH v3 05/12] cgroup/freezer: don't update the frozen state of removed cgroups Shakeel Butt
2026-12-05 18:42 ` sashiko-bot
2026-12-04 18:40 ` [PATCH v3 06/12] cgroup/freezer: test the freeze trap bit under siglock Shakeel Butt
2026-12-04 18:40 ` [PATCH v3 07/12] selftests/cgroup: test cgroup.procs reads across a failed migration Shakeel Butt
2026-12-05 18:42 ` sashiko-bot [this message]
2026-12-04 18:40 ` [PATCH v3 08/12] selftests/cgroup: test the frozen state of a cgroup with tasks and children Shakeel Butt
2026-12-05 18:42 ` sashiko-bot
2026-12-04 18:40 ` [PATCH v3 09/12] selftests/cgroup: test cgroup.kill in and below a threaded cgroup Shakeel Butt
2026-12-05 18:42 ` sashiko-bot
2026-12-04 18:40 ` [PATCH v3 10/12] cgroup: factor out cgroup_kn_break_active() and cgroup_kn_unbreak_active() Shakeel Butt
2026-12-04 18:40 ` [PATCH v3 11/12] cgroup: don't hold cgroup_mutex for cgroup.kill Shakeel Butt
2026-12-05 18:42 ` sashiko-bot
2026-12-04 18:40 ` [PATCH v3 12/12] cgroup/freezer: don't hold cgroup_mutex for cgroup.freeze Shakeel Butt
2026-12-05 18:42 ` sashiko-bot
2026-12-04 18:54 ` [PATCH v3 00/12] cgroup: don't hold cgroup_mutex for cgroup.kill and cgroup.freeze Shakeel Butt
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=sashiko-outbox-251804@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bigeasy@linutronix.de \
--cc=brauner@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@meta.com \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=mkoutny@suse.com \
--cc=oleg@redhat.com \
--cc=roman.gushchin@linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=surenb@google.com \
--cc=tj@kernel.org \
--cc=tjmercier@google.com \
--cc=usama.arif@linux.dev \
/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