<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Luke,</div></div><div><br></div><div><div class="gmail_default" style="font-size:small">Thanks for looking into this.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Nov 27, 2021 at 8:05 AM Luke Nowakowski-Krijger <<a href="mailto:luke.nowakowskikrijger@canonical.com">luke.nowakowskikrijger@canonical.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Update tests to be able to work when memory controller is mounted under<br>
cgroup2 hierarchy.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">I'm thinking whether we could achieve these setup functions</div><div class="gmail_default" style="font-size:small">more generic in cgroup_lib.sh, which to avoid the redundancy</div><div class="gmail_default" style="font-size:small">behavior over and over again in each cgroup sub-test.</div><br></div><div><div class="gmail_default" style="font-size:small">About the compatibility of cgroup V1 and V2 in test, I'd suggest</div><div class="gmail_default" style="font-size:small">following what the LTP C library did in include/tst_cgroup.h.</div><div class="gmail_default" style="font-size:small"><a href="https://github.com/linux-test-project/ltp/blob/master/doc/c-test-api.txt#L2024">https://github.com/linux-test-project/ltp/blob/master/doc/c-test-api.txt#L2024</a></div><br></div><div><div class="gmail_default" style="font-size:small">The solution may be briefly as:</div></div><div class="gmail_default" style="font-size:small"><br></div><div><div class="gmail_default" style="font-size:small"> 1. scan system mounted CGroup path, and judge the situation as one of below:</div><div class="gmail_default" style="font-size:small"> * only CGroup V2 mounted</div><div class="gmail_default" style="font-size:small"> * only CGroup V1 mounted</div><div class="gmail_default" style="font-size:small"> * both CGroup V2 and V1 mounted</div><div class="gmail_default" style="font-size:small"> * no CGroup mounted</div><div class="gmail_default" style="font-size:small"> 2. make use of the system mounted CGroup V2 or TSKIP</div><div class="gmail_default" style="font-size:small"> * goto step 5</div><div class="gmail_default" style="font-size:small"> 3. make use of the system mounted CGroup V1 </div><div class="gmail_default" style="font-size:small"> * goto step 5</div><div class="gmail_default" style="font-size:small"> 4. do mount Cgroup as what we needed (V1 or V2) in test</div></div><div class="gmail_default" style="font-size:small"> * goto step 5<br></div><div class="gmail_default" style="font-size:small"> 5. do cleanup </div><div><br></div><div><div class="gmail_default" style="font-size:small">What do you think?</div></div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>