<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Cc LTP ML.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 2, 2020 at 2:50 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 Tue, Oct 27, 2020 at 9:24 PM Richard Palethorpe <<a href="mailto:rpalethorpe@suse.com" target="_blank">rpalethorpe@suse.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">When memcg.limit_in_bytes is set to PASS_THRESHOLD it's unlikely<br>
swapcached will increase by more than PASS_THRESHOLD unless processes<br>
in other memcgs are also increasing it. Additionally MADV_WILLNEED<br>
must remove pages from memory as it adds more so that the first page<br>
may not be in memory by the time the last page is faulted if the<br>
amount exceeds the memory limit (which it does because CHUNK_SZ ><br>
PASS_THRESSHOLD). Worse if pages are faulted in a non-linear way, or<br>
the process must access some other pages, then there is no guarantee<br>
which parts of the range will be resident in memory. This results in<br>
spurious test failures.<br>
<br>
To solve this we can set PASS_THRESHOLD to 1/4 of CHUNK_SZ and<br>
memcg.limit_in_bytes to 1/2 of CHUNK_SZ (MEM_LIMIT), then mark<br>
MEM_LIMIT bytes as needed. That way the amount in the SwapCache will<br>
easily be more than the threshold. Secondly we can run madvise again<br>
on PASS_THRESHOLD bytes and check that dirtying all of these does not<br>
result in too many page faults. We also run the second test on every<br>
occasion to ensure the test code itself is still valid. If the<br>
original bug is present then both tests fail.<br>
<br>
Finally this prints more diagnostic information to help with debugging<br>
the test.<br>
<br>
While debugging the test a kernel bug was found in 5.9 which effects<br>
CGroupV1 when use_hierarchy=0. This is unlikely to effect many users,<br>
but a fix is pending and will be referenced in the test when<br>
available. It is recommended that you set use_hierarchy=1.<br>
<br>
Signed-off-by: Richard Palethorpe <<a href="mailto:rpalethorpe@suse.com" target="_blank">rpalethorpe@suse.com</a>><br>
Reviewed-by: Li Wang <<a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.com</a>><br>
---<br></blockquote><div><br></div><div><div style="font-size:small">Applied the patch V2, thanks!</div></div><div> </div></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>