[LTP] [PATCH v2 3/3] oom: enable OOM protection for mem lib process

Li Wang liwang@redhat.com
Mon Dec 20 06:01:45 CET 2021


On Fri, Dec 17, 2021 at 10:49 PM Cyril Hrubis <chrubis@suse.cz> wrote:


>
> > +     tst_enable_oom_protection(getpid());
> > +
> >       switch (pid = SAFE_FORK()) {
> >       case 0:
> > +             tst_cancel_oom_protection(getpid());
> >               threads = MAX(1, tst_ncpus() - 1);
> >               child_alloc(testcase, lite, threads);
> >       default:
>
> Looking at the code we have, we always pass getpid(). We may as well
> change the library to use /proc/self/oom_score_adj if 0 is passed
> instead of the pid.
>

Yes, agree with all suggestions (include comments in 1/3 2/3).

-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20211220/9aa0f430/attachment.htm>


More information about the ltp mailing list