[LTP] [PATCH] Fix tst_pollute_memory() safety margin for huge systems
Li Wang
liwang@redhat.com
Wed Jan 27 14:05:52 CET 2021
On Wed, Jan 27, 2021 at 8:27 PM Cyril Hrubis <chrubis@suse.cz> wrote:
> Hi!
> > According my test,malloc amount greater than available memory,then
> invoke the oom-killer.
>
> However that does not mean that allocating MemAvailable or slightly less
> than MemAvailable is safe. In fact it's not, at least that I've been
> told be kernel developers. I will try to figure out something safe
> enough with their help.
>
If we only hope to avoid trigger OOM during allocating until the
MAP_FAILED, I think the knob 'proc/sys/vm/overcommit_memory'
maybe helpful.
e.g.
set overcommit_memory = 2, overcommit_ratio = 85 or 90;
... memory allocating as much as you can ...
restore the value of overcommit_*
--
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20210127/dbf6179c/attachment-0001.htm>
More information about the ltp
mailing list