[LTP] [PATCH 10/16] controllers: Update memcg_control_test to newer test lib and cgroup lib

Luke Nowakowski-Krijger luke.nowakowskikrijger@canonical.com
Wed Mar 2 22:37:27 CET 2022


Hi Li,

On Mon, Jan 24, 2022 at 1:44 AM Li Wang <liwang@redhat.com> wrote:

> Luke Nowakowski-Krijger <luke.nowakowskikrijger@canonical.com> wrote:
>
> 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 this would be nice except that we would need to keep track of the
tst_cg_cgroup structs if we wanted to use safe_cg_* functions in the C lib.
This would be fine if we only wanted to use control files in the test_dir
but it gets more complicated if there are other directories below it that
we would want to set. At least as far as I understand it.

And as Richard mentioned its probably a better idea to just only add the
control files for controllers as we absolutely need them so this wouldn't
be too useful. Plus I think it's easy enough from shell to do a version
check and write to the right control file/directory directly.

So I personally don't think its as important, but I could see in the future
implementing something like this so it mimics the C api. What do you think?


> --
> Regards,
> Li Wang
>
>
Apologies for the hiatus,  I know it's not easy to get back into review
mode for patches you haven't thought about in a while.

Thanks,
- Luke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20220302/a64051f2/attachment.htm>


More information about the ltp mailing list