Re: shell: enable OOM protection by default

[email protected] Tue, 4 Aug 2026 10:40:47 +0000
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>
Hi Andrea,

On Aug 4, 2026, Andrea Cervesato wrote:
> shell: enable OOM protection by default

> +	if [ "$TST_OOM_PROTECTION" = 1 ]; then
> +		_tst_enable_oom_protection
> +	fi

Major: Could the test body run in an unprotected child here, as it does in
the C harness?

This sets -1000 on the same shell that later executes the test functions, so
all workloads forked by existing tests inherit OOM protection. For example,
memcg_limit_in_bytes.sh reaches test_proc_kill() and starts memcg_process in
the background. Linux 7.2 copies oom_score_adj on fork, and its cgroup
documentation says that tasks with -1000 are never killed. That path will
therefore report that memcg_process was not killed instead of observing the
expected cgroup OOM kill.

The commit message says that the test runs in a child, but this patch does not
create that boundary. tst_oom_unprotect() is only called by the new self-test,
so it does not reset the existing workload launch sites.

Verdict - Needs revision

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp