[LTP] [PATCH v3 3/3] oom: enable OOM protection for mem lib process
Li Wang
liwang@redhat.com
Mon Dec 20 10:54:16 CET 2021
Just simply invoke oom protection on mem library to make
it can collect full state of children.
Signed-off-by: Li Wang <liwang@redhat.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
---
testcases/kernel/mem/lib/mem.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c
index ac890491c..a4bede0df 100644
--- a/testcases/kernel/mem/lib/mem.c
+++ b/testcases/kernel/mem/lib/mem.c
@@ -129,8 +129,11 @@ void oom(int testcase, int lite, int retcode, int allow_sigkill)
pid_t pid;
int status, threads;
+ tst_enable_oom_protection(0);
+
switch (pid = SAFE_FORK()) {
case 0:
+ tst_disable_oom_protection(0);
threads = MAX(1, tst_ncpus() - 1);
child_alloc(testcase, lite, threads);
default:
--
2.31.1
More information about the ltp
mailing list