[LTP] [PATCH 3/3] memcontrol04: Copy from kselftest

Li Wang liwang@redhat.com
Wed Feb 9 11:47:46 CET 2022


On Tue, Feb 8, 2022 at 10:04 PM Richard Palethorpe via ltp <
ltp@lists.linux.it> wrote:

> At first glance this test looks the same as memcontrol03. However
> there are some significant changes which complicate combining the two.
>
> Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
> ---
>  runtest/controllers                           |   1 +
>  testcases/kernel/controllers/memcg/.gitignore |   1 +
>  .../kernel/controllers/memcg/memcontrol04.c   | 228 ++++++++++++++++++
>  3 files changed, 230 insertions(+)
>  create mode 100644 testcases/kernel/controllers/memcg/memcontrol04.c
>
> diff --git a/runtest/controllers b/runtest/controllers
> index 4a6f919af..3108a2561 100644
> --- a/runtest/controllers
> +++ b/runtest/controllers
> @@ -20,6 +20,7 @@ memcg_control         memcg_control_test.sh
>  memcontrol01 memcontrol01
>  memcontrol02 memcontrol02
>  memcontrol03 memcontrol03
> +memcontrol04 memcontrol04
>
>  cgroup_fj_function_debug cgroup_fj_function.sh debug
>  cgroup_fj_function_cpuset cgroup_fj_function.sh cpuset
> diff --git a/testcases/kernel/controllers/memcg/.gitignore
> b/testcases/kernel/controllers/memcg/.gitignore
> index 49df1582c..3883cede6 100644
> --- a/testcases/kernel/controllers/memcg/.gitignore
> +++ b/testcases/kernel/controllers/memcg/.gitignore
> @@ -8,3 +8,4 @@
>  memcontrol01
>  memcontrol02
>  memcontrol03
> +memcontrol04
> diff --git a/testcases/kernel/controllers/memcg/memcontrol04.c
> b/testcases/kernel/controllers/memcg/memcontrol04.c
> new file mode 100644
> index 000000000..cdfeff4a4
> --- /dev/null
> +++ b/testcases/kernel/controllers/memcg/memcontrol04.c
> @@ -0,0 +1,228 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*\
> + *
> + * [Description]
> + *
> + * Conversion of the forth kself test in cgroup/test_memcontrol.c.
> + *
> + * Original description:
> + * "First, this test creates the following hierarchy:
> + * A       memory.low = 50M,  memory.max = 200M
> + * A/B     memory.low = 50M,  memory.current = 50M
> + * A/B/C   memory.low = 75M,  memory.current = 50M
> + * A/B/D   memory.low = 25M,  memory.current = 50M
> + * A/B/E   memory.low = 500M, memory.current = 0
> + * A/B/F   memory.low = 0,    memory.current = 50M
>

This test has a high repetition with memcontrol03, I'm just
wondering if any possibility to merge together by defining a
struct tcase?

static struct tcase {
       char *ctrl_file;
} tcases[] = {
       {"memory.min"},
       {"memory.low"}
};

-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20220209/446e5761/attachment.htm>


More information about the ltp mailing list