<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 Thu, Feb 10, 2022 at 2:23 PM Li Wang <<a href="mailto:liwang@redhat.com">liwang@redhat.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"><div dir="ltr"><div dir="ltr"><div style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">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></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div style="font-size:small"></div><div style="font-size:small">Btw, there are some TFAILs from my manual run. </div><div style="font-size:small">(I will look into that try to figure it out tomorrow)</div><div style="font-size:small"><br></div><div style="font-size:small">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></div></div></div></blockquote><div><br></div><div style="font-size:small">It looks like a logic issue here, as we do alloc_pagecache 50MB</div><div style="font-size:small">respectively in the leaf_cg[C, D, E, F] and only the 'memory.low'</div></div></div></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">My apologies, the leaf_cg[E] does not have 50MB page cache</div><div class="gmail_default" style="font-size:small">allocating, that is the main reason with no memory reclaims happening.</div><div class="gmail_default" style="font-size:small">'500MB' low boundary obviously overcommitment, so leaf_cg[E] will</div>get the part of parent’s protection proportional to its actual memory</div><div>usage.<span class="gmail_default" style="font-size:small"> However, it doesn't matter for this case, </span>leaf_cg[E] <span class="gmail_default" style="font-size:small"></span>can <span class="gmail_default" style="font-size:small">get</span></div><div>no event grows as well.<span class="gmail_default" style="font-size:small"> Because it has no memory consumption at all.</span></div><div><br></div><div><div class="gmail_default" style="font-size:small">The fix is still effective unless I misread something again:).</div></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div style="font-size:small">of leaf_cg[E] is large enough (500MB) to avoid triggering low event.</div><div style="font-size:small">The rest cgroups should all have low events, that kernel behavior</div><div style="font-size:small">is correct.</div><div style="font-size:small"><br></div><div style="font-size:small">This failure should be fix with:</div><div style="font-size:small"><br></div><div style="font-size:small">--- a/testcases/kernel/controllers/memcg/memcontrol04.c<br>+++ b/testcases/kernel/controllers/memcg/memcontrol04.c<br>@@ -192,7 +192,7 @@ static void test_memcg_low(void)<br> <br> TST_EXP_EXPR(oom == 0, "(oom events=%ld) == 0", oom);<br> <br>- if (i < E)<br>+ if (i != E)<br> TST_EXP_EXPR(low > 0, "(low events=%ld) > 0", low)<br> else<br> TST_EXP_EXPR(low == 0, "(low events=%ld) == 0", low);<br></div></div><div><br></div><div><br></div><div><div style="font-size:small">And better to add "leaf_cg%d" print in the output:</div><div style="font-size:small">(to show the events from which cgroup)</div><div style="font-size:small"><br></div><span class="gmail_default" style="font-size:small"> </span>TST_EXP_EXPR(oom == 0, "(leaf_cg%d: oom events=%ld) == 0", i, oom);<br><br> <span class="gmail_default" style="font-size:small"></span> <span class="gmail_default"></span>if (i != E)</div><div> <span class="gmail_default" style="font-size:small"></span> <span class="gmail_default" style="font-size:small"></span> <span class="gmail_default" style="font-size:small"></span> <span class="gmail_default"></span> <span class="gmail_default"></span><span class="gmail_default"></span>TST_EXP_EXPR(low > 0, "(leaf_cg%d: low events=%ld) > 0", i, low)</div><div> <span class="gmail_default" style="font-size:small"></span> <span class="gmail_default"></span>else</div><div> <span class="gmail_default" style="font-size:small"></span> <span class="gmail_default" style="font-size:small"></span> <span class="gmail_default" style="font-size:small"></span> <span class="gmail_default" style="font-size:small"></span> <span class="gmail_default"></span><span class="gmail_default"></span><span class="gmail_default"></span><span class="gmail_default"></span>TST_EXP_EXPR(low == 0, "(leaf_cg%d: low events=%ld) == 0", i, low);</div><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>
</blockquote></div><br clear="all"><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>