From: "Michal Koutný" <mkoutny@suse.com>
To: Yosry Ahmed <yosry@kernel.org>
Cc: Wilson Felipe Pereira <wfelipe@google.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Nhat Pham <nphamcs@gmail.com>,
Chengming Zhou <chengming.zhou@linux.dev>,
Tejun Heo <tj@kernel.org>, Shuah Khan <shuah@kernel.org>,
linux-mm@kvack.org, cgroups@vger.kernel.org,
linux-kselftest@vger.kernel.org
Subject: Re: [PATCH 1/2] selftests/cgroup: test_zswap: retry subtree_control write on EBUSY in test_zswap_writeback
Date: Thu, 6 Aug 2026 10:33:12 +0200 [thread overview]
Message-ID: <anRBETN6znndbjyr@localhost.localdomain> (raw)
In-Reply-To: <CAO9r8zM9H8iMOE2FE-H47CMUAExf3VcCf04anT=_Ja=m=sbr4g@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1535 bytes --]
On Mon, Aug 03, 2026 at 11:39:14PM -0700, Yosry Ahmed <yosry@kernel.org> wrote:
> > diff --git a/tools/testing/selftests/cgroup/test_zswap.c b/tools/testing/selftests/cgroup/test_zswap.c
> > index 49b36ee791606..312d51887a1d8 100644
> > --- a/tools/testing/selftests/cgroup/test_zswap.c
> > +++ b/tools/testing/selftests/cgroup/test_zswap.c
> > @@ -407,8 +407,11 @@ static int test_zswap_writeback(const char *root, bool wb)
> > * Thus, the parent's setting shall be what's in effect. */
> > if (cg_write(test_group, "memory.zswap.max", "max"))
> > goto out;
> > - if (cg_write(test_group, "cgroup.subtree_control", "+memory"))
> > - goto out;
> > + while (cg_write(test_group, "cgroup.subtree_control", "+memory")) {
> > + if (errno != EBUSY)
> > + goto out;
> > + usleep(1000);
> > + }
>
> I would honestly rather create a new cgroup here instead of reusing
> the leaf cgroup as a parent, to avoid any subtleties like this in the
> future, or even split test_zswap_writeback() into two test cases. I
> don't feel strongly though if others think the simple wait here is
> enough.
I somewhat agree, I'm not sure whether the recycling brings any signal
to the test.
In the case, the recycling and (re-)enablement is needed, I'd suggest an
explicit check for emptiness, the best of utils arsenal seems:
cg_read_strcmp_wait(test_cgroup, "cgroup.events", "populated 0\n")
Thanks,
Michal
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 265 bytes --]
next prev parent reply other threads:[~2026-08-06 8:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 4:20 [PATCH 0/2] selftests/cgroup: test_zswap: fix single-core flakes Wilson Felipe Pereira
2026-08-04 4:20 ` [PATCH 1/2] selftests/cgroup: test_zswap: retry subtree_control write on EBUSY in test_zswap_writeback Wilson Felipe Pereira
[not found] ` <CAO9r8zM9H8iMOE2FE-H47CMUAExf3VcCf04anT=_Ja=m=sbr4g@mail.gmail.com>
2026-08-06 8:33 ` Michal Koutný [this message]
2026-08-04 4:20 ` [PATCH 2/2] selftests/cgroup: test_zswap: fix implicit unsigned promotion bug in test_no_kmem_bypass Wilson Felipe Pereira
2026-08-06 8:32 ` Michal Koutný
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=anRBETN6znndbjyr@localhost.localdomain \
--to=mkoutny@suse.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=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