dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Albert Esteve" <aesteve@redhat.com>
Cc: dri-devel@lists.freedesktop.org, tj@kernel.org,
	hannes@cmpxchg.org, mkoutny@suse.com
Subject: Re: [PATCH v7 3/3] selftests: cgroup: Add dmem selftest coverage
Date: Tue, 17 Nov 2026 13:33:47 +0000	[thread overview]
Message-ID: <sashiko-outbox-218882@kernel.org> (raw)
In-Reply-To: <20261117-kunit_cgroups-v7-3-5bcbfe17f323@redhat.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] selftests: cgroup: test_dmem always skips under kselftest
  runner
--

commit b1601ac573b3434d7a724ddf07cd272e92c72579
Author: Albert Esteve <aesteve@redhat.com>

selftests: cgroup: Add dmem selftest coverage

This commit adds the test_dmem selftest to verify dmem.max enforcement and
byte-granularity accounting using the dmem_selftest kernel module.

> diff --git a/tools/testing/selftests/cgroup/Makefile b/tools/testing/selftests/cgroup/Makefile
> index a08661320a07c..d01e8eb1ead2d 100644
> --- a/tools/testing/selftests/cgroup/Makefile
> +++ b/tools/testing/selftests/cgroup/Makefile
> @@ -11,6 +11,7 @@ TEST_GEN_MODS_DIR := test_modules
>  TEST_GEN_PROGS  = test_core
>  TEST_GEN_PROGS += test_cpu
>  TEST_GEN_PROGS += test_cpuset
> +TEST_GEN_PROGS += test_dmem
>  TEST_GEN_PROGS += test_freezer
>  TEST_GEN_PROGS += test_hugetlb_memcg
>  TEST_GEN_PROGS += test_kill
[ ... ]
> diff --git a/tools/testing/selftests/cgroup/test_dmem.c b/tools/testing/selftests/cgroup/test_dmem.c
> new file mode 100644
> index 0000000000000..3793664678b91
> --- /dev/null
> +++ b/tools/testing/selftests/cgroup/test_dmem.c
[ ... ]
> +int main(int argc, char **argv)
> +{
> +	char root[PATH_MAX];
> +	struct stat st;
> +	int i;
> +
> +	ksft_print_header();
> +
> +	if (cg_find_unified_root(root, sizeof(root), NULL))
> +		ksft_exit_skip("cgroup v2 isn't mounted\n");
> +
> +	if (cg_read_strstr(root, "cgroup.controllers", "dmem"))
> +		ksft_exit_skip("dmem controller isn't available (CONFIG_CGROUP_DMEM?)\n");
> +
> +	if (cg_read_strstr(root, "cgroup.subtree_control", "dmem"))
> +		if (cg_write(root, "cgroup.subtree_control", "+dmem"))
> +			ksft_exit_skip("Failed to enable dmem controller\n");
> +
> +	if (stat(DM_SELFTEST_ALLOC, &st) < 0)
> +		ksft_exit_skip(
> +			"dmem_selftest helper not loaded (insmod test_modules/dmem_selftest.ko)\n");

[Severity: Medium]
Will test_dmem always be skipped when run via the standard kselftest runner
(make run_tests or run_kselftest.sh)?

The kselftest framework builds and installs modules in TEST_GEN_MODS_DIR,
but runner.sh executes TEST_GEN_PROGS directly without loading those
modules first.  Unless test_dmem loads and unloads
test_modules/dmem_selftest.ko itself (for example via finit_module() and
delete_module()) or is invoked through a wrapper script in TEST_PROGS,
automated kselftest runs will never execute these tests.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261117-kunit_cgroups-v7-0-5bcbfe17f323@redhat.com?part=3

      reply	other threads:[~2026-11-17 13:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 13:27 [PATCH v7 0/3] cgroup: dmem: add selftest helper and coverage Albert Esteve
2026-11-17 13:27 ` [PATCH v7 1/3] selftests: cgroup: Add dmem_selftest helper module Albert Esteve
2026-11-17 13:46   ` sashiko-bot
2026-11-17 13:27 ` [PATCH v7 2/3] selftests: cgroup: Add KB() helper Albert Esteve
2026-11-17 13:27 ` [PATCH v7 3/3] selftests: cgroup: Add dmem selftest coverage Albert Esteve
2026-11-17 13:33   ` sashiko-bot [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=sashiko-outbox-218882@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=aesteve@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hannes@cmpxchg.org \
    --cc=mkoutny@suse.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --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