aboutsummaryrefslogtreecommitdiff
path: root/testcases/kernel/mem
diff options
context:
space:
mode:
authorLi Wang <liwang@redhat.com>2021-12-20 17:54:16 +0800
committerLi Wang <liwang@redhat.com>2021-12-21 19:27:30 +0800
commit34ef0896d4990ab52747406035e53394486cc706 (patch)
treecc844191e06246862e807db0532ccdf76fcad612 /testcases/kernel/mem
parent8e5fe1d5f2b4859f4f29f327f9515e7a9a149d92 (diff)
downloadltp-34ef0896d4990ab52747406035e53394486cc706.tar.gz
oom: enable OOM protection for mem lib process
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> Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Diffstat (limited to 'testcases/kernel/mem')
-rw-r--r--testcases/kernel/mem/lib/mem.c3
1 files changed, 3 insertions, 0 deletions
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: