From: Cyril Hrubis <chrubis@suse.cz>
To: Wei Gao <wegao@suse.com>
Cc: rpalethorpe@suse.com, ltp@lists.linux.it
Subject: Re: [LTP] Question on .needs_cgroup_ctrls for cgroupv2
Date: Mon, 27 Feb 2023 15:58:41 +0100 [thread overview]
Message-ID: <Y/zFIdiWccmVzddV@yuki> (raw)
In-Reply-To: <20230227144402.GA23697@localhost>
Hi!
> How to setup correct test case for cgroupv2 check? I try to put following parameter but failed.
>
> struct tst_test test = {
> ...
> .needs_cgroup_ctrls = (const char *const []){ "unified", NULL },
> .needs_cgroup_ver = TST_CG_V2,
> };
>
>
> After some investigation i found cgroup_find_ctrl which called by tst_cg_require seems not implement
> how to check cgroupv2, the controllers has no "unified" memeber, should we add CGROUP_CTRL_MEMBER("unified", xxx)
> into controllers? Correct me if any misunderstanding.
>
>
> void tst_cg_require(const char *const ctrl_name,
> const struct tst_cg_opts *options)
> {
> struct cgroup_ctrl *const ctrl = cgroup_find_ctrl(ctrl_name);
I think that you are misunderstanding something, controllers that are
checked by the .needs_cgroup_ctrls and tst_cg_require() are cgroup
controllers such as memory or cpu controller.
And unified can be the hierarchy, that means that all controllers are in
a single mount point which is how controllers are presented in the
cgroup V2.
You can have a mix of V1 and V2 controllers on a system and LTP library
abstracts away all the details so that you can focus on the test logic
rather than on how things are set up on the system. You have to start by
specifying which controllers is the test going to use, that's the
.needs_cgroup_ctrls array and if the test is V2 only you pass the
TST_CG_V2 in the flags.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2023-02-27 14:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-27 14:44 [LTP] Question on .needs_cgroup_ctrls for cgroupv2 Wei Gao via ltp
2023-02-27 14:58 ` Cyril Hrubis [this message]
2023-02-27 15:17 ` Wei Gao via ltp
2023-02-27 15:28 ` Cyril Hrubis
2023-02-27 15:52 ` Richard Palethorpe
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=Y/zFIdiWccmVzddV@yuki \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
--cc=rpalethorpe@suse.com \
--cc=wegao@suse.com \
/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