From: Richard Palethorpe <rpalethorpe@suse.de>
To: Li Wang <liwang@redhat.com>
Cc: LTP List <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH v3 2/5] API/cgroup: Declare required controllers and version in test struct
Date: Tue, 08 Feb 2022 09:09:40 +0000 [thread overview]
Message-ID: <87czjxwwgc.fsf@suse.de> (raw)
In-Reply-To: <CAEemH2d-K=X0aodrLV=4AiVE-GWDkHv3+Rxf_NUq8btH=jF77A@mail.gmail.com>
Hello,
Li Wang <liwang@redhat.com> writes:
> Hi Richard,
>
> Richard Palethorpe <rpalethorpe@suse.com> wrote:
>
>
> --- a/include/tst_cgroup.h
> +++ b/include/tst_cgroup.h
> ...
>
> /* A Control Group in LTP's aggregated hierarchy */
> struct tst_cgroup_group;
>
> +/* Populated with a reference to this tests's CGroup */
> +extern const struct tst_cgroup_group *const tst_cgroup;
> +extern const struct tst_cgroup_group *const tst_cgroup_drain;
>
>
>
> --- a/lib/tst_cgroup.c
> +++ b/lib/tst_cgroup.c
> @@ -18,7 +18,6 @@
> #include "lapi/mount.h"
> #include "lapi/mkdirat.h"
> #include "tst_safe_file_at.h"
> -#include "tst_cgroup.h"
>
> struct cgroup_root;
>
> @@ -138,6 +137,14 @@ struct tst_cgroup_group {
> struct cgroup_dir *dirs[ROOTS_MAX + 1];
> };
>
> +/* If controllers are required via the tst_test struct then this is
> + * populated with the test's CGroup.
> + */
> +static struct tst_cgroup_group test_group;
> +static struct tst_cgroup_group drain_group;
> +const struct tst_cgroup_group *const tst_cgroup = &test_group;
>
> What about declaring as 'tst_cgroup_test' ? i.e.
>
> const struct tst_cgroup_group *const tst_cgroup_test = &test_group;
>
> As it is a reference to test's CGroup and the test_dir is the same
> layer with drain_dir, so this will be easier to understand the relationship
> with drain_group.
>
> +const struct tst_cgroup_group *const tst_cgroup_drain =
> &drain_group;
I agree with your logic, but the variable name is too long even without
'_test'. Perhaps we could shorten cgroup to cg? However I can submit a
separate patch for that.
>
> The rest part looks quite good.
> Reviewed-by: Li Wang <liwang@redhat.com>
--
Thank you,
Richard.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-02-08 9:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-07 14:16 [LTP] [PATCH v3 0/5] Add memcontrol03 and declarative CG API Richard Palethorpe via ltp
2022-02-07 14:16 ` [LTP] [PATCH v3 1/5] memcontrol: Lift out some common definitions into a shared header Richard Palethorpe via ltp
2022-02-07 14:16 ` [LTP] [PATCH v3 2/5] API/cgroup: Declare required controllers and version in test struct Richard Palethorpe via ltp
2022-02-08 7:16 ` Li Wang
2022-02-08 9:09 ` Richard Palethorpe [this message]
2022-02-08 9:24 ` Li Wang
2022-02-08 9:46 ` Richard Palethorpe
2022-02-07 14:16 ` [LTP] [PATCH v3 3/5] API/cgroup: Add memory.min Richard Palethorpe via ltp
2022-02-08 7:20 ` Li Wang
2022-02-07 14:16 ` [LTP] [PATCH v3 4/5] API/cgroup: Make tst_cgroup_group_mk sprintf like Richard Palethorpe via ltp
2022-02-07 15:45 ` Cyril Hrubis
2022-02-08 7:27 ` Li Wang
2022-02-07 14:16 ` [LTP] [PATCH v3 5/5] memcontrol03: Copy from kselftest Richard Palethorpe via ltp
2022-02-08 8:08 ` Li Wang
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=87czjxwwgc.fsf@suse.de \
--to=rpalethorpe@suse.de \
--cc=liwang@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.