From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: "Li Wang" <li.wang@linux.dev>
Cc: Linux Test Project <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH v4] shell: enable OOM protection by default
Date: Tue, 11 Aug 2026 10:20:57 +0000 [thread overview]
Message-ID: <6a7af78a.df882948.2caf51.fc9a@mx.google.com> (raw)
In-Reply-To: <anqQXb08RqRK-74w@linux.dev>
Hi Li,
> Hi Andrea, Petr,
>
> After looking into it more, now I slightly think doing OOM protection
> in the shell harness isn't worth it: the benefit doesn't justify the
> complexity. Forking the whole test body means dealing with cleanup and
> timer ownership across the fork, plus passing results back from the
> child, and all of that would need revalidating for every shell test
> that goes through tst_test.sh.
>
> Given that only a few tests actually produce memory pressure, I'd
> rather keep it simple and handle it locally in those tests instead of
> touching the common harness. Something like a small helper the test
> can wrap the memory hungry workload with:
>
> tst_oom_run()
> {
> ( echo 0 > /proc/self/oom_score_adj; exec "$@" )
> }
>
> The harness (or the setup) protects itself with oom_score_adj -1000,
> and only the workload started via tst_oom_run stays killable.
> This keeps the harness alive to report results without forking the
> whole test body, and matches the C harness model where the worker is
> the unprotected part.
>
> Does this direction make sense to you, or do you see a case that
> really needs the protection to be harness-wide?
I think you are right, perhaps these shell tests need to be rewritten in
C anyway. Most of them are unstable and fificult to maintain (like all
shell scripts anyway).
I can go back to my original idea of setting oom protection only
for specific tests.
>
> > Suggested-by: Li Wang <liwang@redhat.com>
>
> This email address is no longer in use :).
Ah damn.. :-D
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2026-08-11 10:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 11:13 [LTP] [PATCH v4] shell: enable OOM protection by default Andrea Cervesato
2026-08-10 13:10 ` [LTP] " linuxtestproject.agent
2026-08-10 17:14 ` Petr Vorel
2026-08-10 17:31 ` [LTP] [PATCH v4] " Petr Vorel
2026-08-11 3:00 ` Li Wang
2026-08-11 4:45 ` Petr Vorel
2026-08-11 10:20 ` Andrea Cervesato via ltp [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6a7af78a.df882948.2caf51.fc9a@mx.google.com \
--to=ltp@lists.linux.it \
--cc=andrea.cervesato@suse.com \
--cc=li.wang@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox