<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><div><div class="gmail_default"><br></div></div></div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 24, 2021 at 9:33 PM Martin Doucha <<a href="mailto:mdoucha@suse.cz" target="_blank">mdoucha@suse.cz</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">On 24. 06. 21 15:22, Krzysztof Kozlowski wrote:<br>
> On big memory systems, e.g. 196 GB RAM machine, the ioctl_sg01 test was<br>
> failing because of OoM killer during memory pollution:<br>
> <br>
> ...<br>
> <br>
> It seems leaving hard-coded 128 MB free memory works for small or medium<br>
> systems, but for such bigger machine it creates significant memory<br>
> pressure triggering the out of memory reaper.<br>
> <br>
> The memory pressure usually is defined by ratio between free and total<br>
> memory, so adjust the safety/spare memory similarly to keep always 0.5%<br>
> of memory free.<br>
<br>
Hi,<br>
I've sent a similar patch for the same issue a while ago. It covers a<br>
few more edge cases. See [1] for the discussion about it.</blockquote><div class="gmail_default" style="font-size:small"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
[1]<br>
<a href="https://patchwork.ozlabs.org/project/ltp/patch/20210127115606.28985-1-mdoucha@suse.cz/" rel="noreferrer" target="_blank">https://patchwork.ozlabs.org/project/ltp/patch/20210127115606.28985-1-mdoucha@suse.cz/</a></blockquote><div><br></div><div class="gmail_default" style="font-size:small">FYI, Another related analysis: <a href="https://lists.linux.it/pipermail/ltp/2021-April/021903.html">https://lists.linux.it/pipermail/ltp/2021-April/021903.html</a></div><div><div class="gmail_default"><br></div>The mmap() behavior changed in GUESS mode from commit 8c7829b04c523cd,<br>we can NOT receive MAP_FAILED on ENOMEM in userspace anymore,<span class="gmail_default"> </span>unless<span class="gmail_default"> </span></div><div><span class="gmail_default"></span>the process one-time allocating memory larger than "total_ram+ total_swap" explicitly.</div><div><br></div><div class="gmail_default">Which also means the MAP_FAILED check lose effect permanently in line#51:</div><div class="gmail_default" style="font-size:small"><a href="https://github.com/linux-test-project/ltp/blob/master/lib/tst_memutils.c#L51">https://github.com/linux-test-project/ltp/blob/master/lib/tst_memutils.c#L51</a></div></div><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>