All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Palethorpe <rpalethorpe@suse.de>
To: Li Wang <liwang@redhat.com>
Cc: LTP List <ltp@lists.linux.it>,
	Luke Nowakowski-Krijger <luke.nowakowskikrijger@canonical.com>
Subject: Re: [LTP] [PATCH 10/16] controllers: Update memcg_control_test to newer test lib and cgroup lib
Date: Mon, 24 Jan 2022 12:24:44 +0000	[thread overview]
Message-ID: <877dapz5er.fsf@suse.de> (raw)
In-Reply-To: <CAEemH2fDx-KejrtrmY_N9c+7Fbe1Btvpxe65rUPyC8Atw_=+nA@mail.gmail.com>

Hello Li,

Li Wang <liwang@redhat.com> writes:

> Luke Nowakowski-Krijger <luke.nowakowskikrijger@canonical.com> wrote:
>
>> +test1()
>>  {
>> -       TST_COUNT=1
>> -       tst_resm TINFO "Test #1: Checking if the memory usage limit imposed by the topmost group is enforced"
>> +       cd $TST_TMPDIR
>> +
>> +       tst_res TINFO "Test #1: Checking if the memory usage limit imposed by the topmost group is enforced"
>>
>> -       echo "$ACTIVE_MEM_LIMIT" > $TST_PATH/mnt/$TST_NUM/memory.limit_in_bytes
>> -       echo "$TOT_MEM_LIMIT" > $TST_PATH/mnt/$TST_NUM/memory.memsw.limit_in_bytes
>> +       ROD echo "$ACTIVE_MEM_LIMIT" > "$test_dir/$memory_limit"
>> +       ROD echo "$TOT_MEM_LIMIT" > "$test_dir/$memsw_memory_limit"
> ...
>>  }
>
>> +setup()
>>  {
>> -       RES=$1
>> -       INFO=$2
>> -
>> -       if [ $RES -eq $PASS ]; then
>> -               tst_resm TPASS "$INFO"
>> +       cgroup_require "memory"
>> +       cgroup_v=$(cgroup_get_version "memory")
>> +       test_dir=$(cgroup_get_test_path "memory")
>> +       task_list=$(cgroup_get_task_list "memory")
>> +
>> +       if [ "$cgroup_v" = "V2" ]; then
>> +               memory_limit="memory.max"
>> +               memsw_memory_limit="memory.swap.max"
>
> As we already built the controller files mapping from V2 to V1
> in C library and you actually add many new (in patch 5/16).
>
> I'm thinking maybe we could make use of it in tst_cgctl.c to
> avoid handling these (in shell) separately.
>
> Something like:
>
>     # ./tst_cgctl  set  "$pid"  "cgroup.procs"  "$target_pid"
>     # ./tst_cgctl  set  "$pid"  "memory.max"  "$ACTIVE_MEM_LIMIT"
>
> Otherwise, it seems to make no sense to add so many new
> files mapping (like that patch 5/16) at this moment.
>
> What do you think?

I think it looks nice!

>
>
>>         else
>> -               : $((FAILED_CNT += 1))
>> -               tst_resm TFAIL "$INFO"
>> +               memory_limit="memory.limit_in_bytes"
>> +               memsw_memory_limit="memory.memsw.limit_in_bytes"
>>         fi
>> -}


-- 
Thank you,
Richard.

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2022-01-24 12:26 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-19 14:44 [LTP] [PATCH 00/16] Expand Cgroup lib and modify controller tests Luke Nowakowski-Krijger
2022-01-19 14:44 ` [LTP] [PATCH v2 01/16] API/cgroup: Modify tst_cgroup_print_config for easier parsing and consumption Luke Nowakowski-Krijger
2022-01-24 11:16   ` Richard Palethorpe
2022-01-19 14:44 ` [LTP] [PATCH 02/16] API/cgroup: Add option for specific pid to tst_cgroup_opts Luke Nowakowski-Krijger
2022-01-19 14:44 ` [LTP] [PATCH v2 03/16] API/cgroup: Add cgroup_find_root helper function Luke Nowakowski-Krijger
2022-01-19 14:44 ` [LTP] [PATCH v2 04/16] API/cgroup: Implement tst_cgroup_load_config() Luke Nowakowski-Krijger
2022-01-24 12:05   ` Richard Palethorpe
2022-03-02 18:08     ` Luke Nowakowski-Krijger
2022-01-19 14:44 ` [LTP] [PATCH 05/16] API/cgroup: Add more controllers to tst_cgroup Luke Nowakowski-Krijger
2022-01-24  7:10   ` Li Wang
2022-01-24  7:21     ` Li Wang
2022-01-24 11:36   ` Richard Palethorpe
2022-01-19 14:44 ` [LTP] [PATCH 06/16] API/cgroup: Change to TWARN when v2 controllers change Luke Nowakowski-Krijger
2022-01-24 10:44   ` Richard Palethorpe
2022-01-19 14:44 ` [LTP] [PATCH 07/16] testcases/lib: Implement tst_cgctl binary Luke Nowakowski-Krijger
2022-01-24  7:54   ` Li Wang
2022-01-19 14:44 ` [LTP] [PATCH v2 08/16] controllers: Expand cgroup_lib shell library Luke Nowakowski-Krijger
2022-01-19 14:44 ` [LTP] [PATCH 09/16] controllers: Update cgroup_fj_* to use newer cgroup lib and test lib Luke Nowakowski-Krijger
2022-01-24  8:51   ` Li Wang
2022-03-02 23:41     ` Luke Nowakowski-Krijger
2022-01-19 14:44 ` [LTP] [PATCH 10/16] controllers: Update memcg_control_test to newer test lib and cgroup lib Luke Nowakowski-Krijger
2022-01-24  9:43   ` Li Wang
2022-01-24 12:24     ` Richard Palethorpe [this message]
2022-03-02 21:37     ` Luke Nowakowski-Krijger
2022-03-04  7:11       ` Li Wang
2022-01-19 14:44 ` [LTP] [PATCH 11/16] controllers: Update memcg/regression/* to new test " Luke Nowakowski-Krijger
2022-01-19 14:44 ` [LTP] [PATCH 12/16] controllers: Update memcg_stress_test to use newer " Luke Nowakowski-Krijger
2022-01-19 14:44 ` [LTP] [PATCH 13/16] controllers: update memcg/functional " Luke Nowakowski-Krijger
2022-01-19 14:44 ` [LTP] [PATCH 14/16] controllers: Update pids.sh " Luke Nowakowski-Krijger
2022-01-24 12:26   ` Richard Palethorpe
2022-01-19 14:44 ` [LTP] [PATCH 15/16] controllers: update cpuset_regression_test.sh " Luke Nowakowski-Krijger
2022-01-19 14:44 ` [LTP] [PATCH 16/16] controllers: update cgroup_regression_test " Luke Nowakowski-Krijger
2022-01-24  9:40 ` [LTP] [PATCH 00/16] Expand Cgroup lib and modify controller tests 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=877dapz5er.fsf@suse.de \
    --to=rpalethorpe@suse.de \
    --cc=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    --cc=luke.nowakowskikrijger@canonical.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 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.