Linux cgroups development
 help / color / mirror / Atom feed
From: SJ Park <sj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "SJ Park" <sj@kernel.org>,
	"Wilson Felipe Pereira" <wfelipe@google.com>,
	"Johannes Weiner" <hannes@cmpxchg.org>,
	"Yosry Ahmed" <yosry@kernel.org>, "Nhat Pham" <nphamcs@gmail.com>,
	"Shuah Khan" <shuah@kernel.org>,
	"Anshuman Khandual" <anshuman.khandual@arm.com>,
	"Tejun Heo" <tj@kernel.org>, " Michal Koutný " <mkoutny@suse.com>,
	"Chengming Zhou" <chengming.zhou@linux.dev>,
	linux-mm@kvack.org, cgroups@vger.kernel.org,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v2] selftests/cgroup: test_zswap: skip test_no_kmem_bypass if debugfs is unavailable
Date: Tue, 11 Aug 2026 19:45:53 -0700	[thread overview]
Message-ID: <20260812024553.8493-1-sj@kernel.org> (raw)
In-Reply-To: <20260811190611.c72f19ada3912791a81a7a90@linux-foundation.org>

On Tue, 11 Aug 2026 19:06:11 -0700 Andrew Morton <akpm@linux-foundation.org> wrote:

> On Tue, 11 Aug 2026 05:14:11 +0000 Wilson Felipe Pereira <wfelipe@google.com> wrote:
> 
> > test_no_kmem_bypass() needs to read
> > /sys/kernel/debug/zswap/stored_pages via get_zswap_stored_pages() to
> > verify that compressed pages are charged to the memcg.
> > 
> > When running in an environment where debugfs is not mounted or
> > CONFIG_DEBUG_FS is disabled, get_zswap_stored_pages() fails, causing the
> > loop to terminate early and report a false negative (KSFT_FAIL).
> > 
> > Selftests should not fail if debugfs is unavailable, and it should print
> > a message when it is skipped.
> > 
> > While I'm here, also add a warning message if the test is being skipped
> > due to totalram size and make the check for totalram more readable.
> > 
> > ...
> >
> > --- a/tools/testing/selftests/cgroup/lib/include/cgroup_util.h
> > +++ b/tools/testing/selftests/cgroup/lib/include/cgroup_util.h
> >
> > ...
> >
> > @@ -570,8 +571,16 @@ static int test_no_kmem_bypass(const char *root)
> >  	/* Read sys info and compute test values accordingly */
> >  	if (sysinfo(&sys_info) != 0)
> >  		return KSFT_FAIL;
> > -	if (sys_info.totalram > 5000000000)
> > +	if (sys_info.totalram > GB(4)) {
> > +		ksft_print_msg(
> > +			"requires less than 4GB total ram, sys_info.totalram: %.1fGB\n",
> > +			(double)sys_info.totalram / GB(1));
> >  		return KSFT_SKIP;
> > +	}
> > +	if (access(PATH_ZSWAP_STORED_PAGES, R_OK)) {
> > +		ksft_print_msg("mount debugfs at /sys/kernel/debug\n");
> 
> Super nittynit: "mount debugfs at /sys/kernel/debug" sounds like a
> progress message.  "I just mounted debugfs at ...".  I think the below is
> more clear?

+1.  I was feeling similar.

> 
> --- a/tools/testing/selftests/cgroup/test_zswap.c~selftests-cgroup-test_zswap-skip-test_no_kmem_bypass-if-debugfs-is-unavailable-fix
> +++ a/tools/testing/selftests/cgroup/test_zswap.c
> @@ -578,7 +578,7 @@ static int test_no_kmem_bypass(const cha
>  		return KSFT_SKIP;
>  	}
>  	if (access(PATH_ZSWAP_STORED_PAGES, R_OK)) {
> -		ksft_print_msg("mount debugfs at /sys/kernel/debug\n");
> +		ksft_print_msg("debugfs not mounted at /sys/kernel/debug\n");

This reads better for me.  I also find this is more consistent to similar skip
messages in main() and check_zswap_enabled().

>  		return KSFT_SKIP;
>  	}
>  	values = mmap(0, sizeof(struct no_kmem_bypass_child_args), PROT_READ |
> _


Thanks,
SJ

      parent reply	other threads:[~2026-08-12  2:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-11  5:14 [PATCH v2] selftests/cgroup: test_zswap: skip test_no_kmem_bypass if debugfs is unavailable Wilson Felipe Pereira
2026-08-11 16:41 ` Yosry Ahmed
2026-08-11 19:20 ` Nhat Pham
2026-08-12  2:06 ` Andrew Morton
2026-08-12  2:33   ` Anshuman Khandual
2026-08-12  2:45   ` SJ Park [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=20260812024553.8493-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=cgroups@vger.kernel.org \
    --cc=chengming.zhou@linux.dev \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mkoutny@suse.com \
    --cc=nphamcs@gmail.com \
    --cc=shuah@kernel.org \
    --cc=tj@kernel.org \
    --cc=wfelipe@google.com \
    --cc=yosry@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