<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 13, 2020 at 11:19 AM Yang Xu <<a href="mailto:xuyang2018.jy@cn.fujitsu.com">xuyang2018.jy@cn.fujitsu.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">Hi Hanxiao<br>
<br>
> Hi, Yang<br>
><br>
>> -----閭欢鍘熶欢-----<br>
>> 涓婚: Re: [LTP] [PATCH] memcg_use_hierarchy_test.sh: skip setting<br>
>> use_hierarchy if not available<br>
>><br>
>> Hi hanxiao<br>
>><br>
>><br>
>>> The precondition of this case is that we can disable use_hierarchy.<br>
>>> But some distributions such as CentOS 8 had enabled it in root cgroup<br>
>>> and hard to disabled.<br>
> [snip]<br>
>> /dev/memcg/memory.use_hierarchy" \<br>
>>> +                                    "to 0 failed"<br>
>>> +                        fi<br>
>>> +                fi<br>
>> I test this patch on centos7 and testcase2 skips. On centos7(without installing<br>
>> docker), /sys/fs/cgroup/memory/memory.use_hierarchy value is equal to 1 and I<br>
>> still can disable value for /dev/memcg/memory.use_hierarchy.<br>
>><br>
> The behavior above looks conflicting with <a href="https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt" rel="noreferrer" target="_blank">https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt</a>.<br>
Yes. Centos7 behavior is different from the documentation.<br>
>> So why not directly use /dev/memcg/memory.use_hierarchy value to judge in<br>
>> testcase after setting 0.<br>
> In setup_test from memcg_lib.sh, we actually did:<br>
>     mount -t cgroup -omemory memcg /dev/memcg<br>
> Then kernel will find a suitable cgroup root for us in cgroup1_mount.<br>
><br>
> In this case, /sys/fs/cgroup/memory/ would be the good choice.<br>
> So it's equivalent to read memory.use_hierarchy from either side.<br>
I understand. Only a minor suggestion, please use tabs instead of spaces<br>
at the beginning of the line.<br>
<br>
<br>
This patch looks good to me,<br>
Acked-by: Yang Xu <<a href="mailto:xuyang2018.jy@cn.fujitsu.com" target="_blank">xuyang2018.jy@cn.fujitsu.com</a>><br>
<br>
@Li, I think this patch is ok, Do you have some comment about it?<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">I'm ok to go with memory.use_hierarchy checking in the preconditioning phase.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">But how can you assert the default memory cgroup is mount at path: "/sys/fs/cgroup/memory", is there any possibility the default path mount at other places(for different distribution)?</div><div class="gmail_default" style="font-size:small"></div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>