From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v4 1/4] lib: add new cgroup test API
Date: Tue, 9 Jun 2020 06:42:42 -0400 (EDT) [thread overview]
Message-ID: <1111554317.15300411.1591699362992.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20200609095102.21153-1-liwang@redhat.com>
----- Original Message -----
> Many of our LTP tests need Control Group in the configuration,
> this patch makes cgroup unified mounting at setup phase to be
> possible. The method?is extracted from mem.h with the purpose
> of?extendible for further developing, and trying?to compatible
> the current two versions of cgroup,
>
> It's hard to make all APIs be strictly consistent because there
> are many differences between v1 and v2. But it?capsulate the detail
> of cgroup mounting in high-level functions, which will be easier
> to use cgroup without considering too much technical thing.
>
> Btw, test get passed on RHEL7(x86_64), RHEL8(ppc64le), Fedora32(x86_64).
>
No strong objections to v4, couple comments below (if you spin v5 because
of other reviews).
> +2.2.36 Using Control Group
> +^^^^^^^^^^^^^^^^^^^^^^^^^^
Would be nice if there was short description of each function.
> +static void tst_cgroup_set_path(const char *cgroup_dir)
> +{
> + char cgroup_new_dir[PATH_MAX];
> + struct tst_cgroup_path *tst_cgroup_path, *a;
> +
> + if (!cgroup_dir)
> + tst_brk(TBROK, "Invalid cgroup dir, plese check cgroup_dir");
> +
> + sprintf(cgroup_new_dir, "%s/ltp_%d", cgroup_dir, rand());
> +
> + /* To store cgroup path in the 'path' list */
> + tst_cgroup_path = SAFE_MMAP(NULL, (sizeof(struct tst_cgroup_path)),
> + PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
This looks like it could use just SAFE_MALLOC/SAFE_FREE.
next prev parent reply other threads:[~2020-06-09 10:42 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-09 9:50 [LTP] [PATCH v4 1/4] lib: add new cgroup test API Li Wang
2020-06-09 9:51 ` [LTP] [PATCH v4 2/4] mem: take use of new cgroup API Li Wang
2020-06-09 9:51 ` [LTP] [PATCH v4 3/4] mem: remove the old " Li Wang
2020-06-09 9:51 ` [LTP] [PATCH v4 4/4] mm: add cpuset01 to runtest file Li Wang
2020-06-19 7:35 ` Petr Vorel
2020-06-09 10:42 ` Jan Stancek [this message]
2020-06-10 10:12 ` [LTP] [PATCH v4 1/4] lib: add new cgroup test API Li Wang
2020-06-19 3:07 ` Li Wang
2020-06-22 13:10 ` Petr Vorel
2020-06-23 0:10 ` Li Wang
2020-09-23 11:03 ` Richard Palethorpe
2020-09-23 12:23 ` Li Wang
2020-09-23 13:14 ` Richard Palethorpe
2020-09-23 14:40 ` Li Wang
2020-09-24 8:55 ` 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=1111554317.15300411.1591699362992.JavaMail.zimbra@redhat.com \
--to=jstancek@redhat.com \
--cc=ltp@lists.linux.it \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.