<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Richard,</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 14, 2022 at 2:07 PM Richard Palethorpe <<a href="mailto:rpalethorpe@suse.de">rpalethorpe@suse.de</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">Hello Li,<br>
<br>
Li Wang <<a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.com</a>> writes:<br>
<br>
> On Thu, Feb 10, 2022 at 2:23 PM Li Wang <<a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.com</a>> wrote:<br>
><br>
> On Wed, Feb 9, 2022 at 7:05 PM Li Wang <<a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.com</a>> wrote:<br>
> <br>
> Btw, there are some TFAILs from my manual run. <br>
> (I will look into that try to figure it out tomorrow)<br>
><br>
> tst_test.c:1521: TINFO: Testing on ext4<br>
> tst_test.c:996: TINFO: Formatting /dev/loop0 with ext4 opts='' extra opts=''<br>
> mke2fs 1.46.5 (30-Dec-2021)<br>
> tst_test.c:1452: TINFO: Timeout per run is 0h 05m 00s<br>
> memcontrol04.c:118: TINFO: Child 242775 in leaf_C: Allocating pagecache: 52428800<br>
> memcontrol04.c:118: TINFO: Child 242776 in leaf_D: Allocating pagecache: 52428800<br>
> memcontrol04.c:118: TINFO: Child 242777 in leaf_F: Allocating pagecache: 52428800<br>
> memcontrol04.c:99: TINFO: Child 242778 in trunk_G: Allocating anon: 155189248<br>
> memcontrol04.c:170: TPASS: Expect: (A/B memory.current=54181888) ~= 52428800<br>
> memcontrol04.c:176: TPASS: Expect: (A/B/C memory.current=30957568) ~= 34603008<br>
> memcontrol04.c:178: TPASS: Expect: (A/B/D memory.current=22282240) ~= 17825792<br>
> memcontrol04.c:180: TPASS: Expect: (A/B/E memory.current=0) ~= 0<br>
> memcontrol04.c:99: TINFO: Child 242779 in trunk_G: Allocating anon: 174063616<br>
> memcontrol04.c:193: TPASS: Expect: (oom events=0) == 0<br>
> memcontrol04.c:196: TPASS: Expect: (low events=373) > 0<br>
> memcontrol04.c:193: TPASS: Expect: (oom events=0) == 0<br>
> memcontrol04.c:196: TPASS: Expect: (low events=373) > 0<br>
> memcontrol04.c:193: TPASS: Expect: (oom events=0) == 0<br>
> memcontrol04.c:198: TPASS: Expect: (low events=0) == 0<br>
> memcontrol04.c:193: TPASS: Expect: (oom events=0) == 0<br>
> memcontrol04.c:198: TFAIL: Expect: (low events=370) == 0<br>
><br>
> It looks like a logic issue here, as we do alloc_pagecache 50MB<br>
> respectively in the leaf_cg[C, D, E, F] and only the 'memory.low'<br>
><br>
> My apologies, the leaf_cg[E] does not have 50MB page cache<br>
> allocating, that is the main reason with no memory reclaims happening.<br>
> '500MB' low boundary obviously overcommitment, so leaf_cg[E] will<br>
> get the part of parent’s protection proportional to its actual memory<br>
> usage. However, it doesn't matter for this case, leaf_cg[E] can get<br>
> no event grows as well. Because it has no memory consumption at all.<br>
<br>
leaf_cg[F]'s memory.low == 0. So how can it have reclaim events where<br>
memory.current < memory.low?<br>
<br>
Testing on the upstream kernel there are no low events in F.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">A bit weird...</div><br></div><div><div class="gmail_default" style="font-size:small">From my test, it indeed has the events that occur.</div><div class="gmail_default" style="font-size:small">(even the original test fail as the same)</div><div class="gmail_default" style="font-size:small">And the leaf_cg[F]'s memory.current is almost 1MB.</div><br></div><div><div class="gmail_default" style="font-size:small"><span class="gmail_default"></span># uname -r</div><div class="gmail_default" style="font-size:small">5.17.0-rc4.liwang</div><div class="gmail_default" style="font-size:small"></div><div class="gmail_default" style="font-size:small">...</div></div><div class="gmail_default" style="font-size:small">tst_test.c:1521: TINFO: Testing on xfs</div>tst_test.c:996: TINFO: Formatting /dev/loop0 with xfs opts='' extra opts=''<br>tst_test.c:1452: TINFO: Timeout per run is 0h 05m 00s<br>memcontrol04.c:118: TINFO: Child 21200 in leaf_C: Allocating pagecache: 52428800<br>memcontrol04.c:118: TINFO: Child 21201 in leaf_D: Allocating pagecache: 52428800<br>memcontrol04.c:118: TINFO: Child 21202 in leaf_F: Allocating pagecache: 52428800<br>memcontrol04.c:99: TINFO: Child 21203 in trunk_G: Allocating anon: 155189248<br>memcontrol04.c:170: TPASS: Expect: (A/B memory.current=54083584) ~= 52428800<br>memcontrol04.c:176: TPASS: Expect: (A/B/C memory.current=29822976) ~= 34603008<br>memcontrol04.c:178: TPASS: Expect: (A/B/D memory.current=22061056) ~= 17825792<br>memcontrol04.c:180: TPASS: Expect: (A/B/E memory.current=0) ~= 0<br>memcontrol04.c:99: TINFO: Child 21204 in trunk_G: Allocating anon: 174063616<br>memcontrol04.c:193: TPASS: Expect: (leaf_cg0: oom events=0) == 0<br>memcontrol04.c:196: TPASS: Expect: (leaf_cg0: low events=427) > 0<br>memcontrol04.c:193: TPASS: Expect: (leaf_cg1: oom events=0) == 0<br>memcontrol04.c:196: TPASS: Expect: (leaf_cg1: low events=427) > 0<br>memcontrol04.c:193: TPASS: Expect: (leaf_cg2: oom events=0) == 0<br>memcontrol04.c:198: TPASS: Expect: (leaf_cg2: low events=0) == 0<br>memcontrol04.c:193: TPASS: Expect: (leaf_cg3: oom events=0) == 0<br>memcontrol04.c:198: TFAIL: Expect: (leaf_cg3: low events=415) == 0<br><br>Summary:<br>passed 44<br>failed 4<br>broken 0<br>skipped 0<br>warnings 0</div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><div class="gmail_default" style="font-size:small"># pwd</div>/root/linux-5.17-rc4/tools/testing/selftests/cgroup<br><br><span class="gmail_default" style="font-size:small"></span># ./test_memcontrol <br>ok 1 test_memcg_subtree_control<br>ok 2 test_memcg_current<br>ok 3 test_memcg_min<br>not ok 4 test_memcg_low<br><div class="gmail_default" style="font-size:small"><br></div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>