[LTP] [PATCH 2/3] ltp: enable OOM protection for main and test harness process

Li Wang liwang@redhat.com
Fri Dec 17 02:50:20 CET 2021


On Thu, Dec 16, 2021 at 5:56 PM Martin Doucha <mdoucha@suse.cz> wrote:

> Hi,
>
> On 16. 12. 21 4:41, Li Wang wrote:
> > diff --git a/lib/tst_test.c b/lib/tst_test.c
> > index ce2b8239d..f3ae48240 100644
> > --- a/lib/tst_test.c
> > +++ b/lib/tst_test.c
> > @@ -1441,11 +1441,15 @@ static int fork_testrun(void)
> >
> >       SAFE_SIGNAL(SIGINT, sigint_handler);
> >
> > +     tst_enable_oom_protection(getppid());
>
> this is exactly what you should *NOT* do because then the OOM protection
> will also be inherited by all non-LTP processes executed by the same
> shell (or whatever the parent process is).
>

You are right! I previously thought the parent process is only ltp-pan
and we only need to cancel the protection in fork_testrun's children.
But obviously, one thing I neglected is that some shell tests will still
under the affected. And furthermore if run LTP test manually the parent
will be the shell, non-LTP process also inherits the score.

Thanks for pointing out this, I will remove this line in V2.

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


More information about the ltp mailing list