diff options
Diffstat (limited to 'testcases/kernel/mem/oom/oom04.c')
-rw-r--r-- | testcases/kernel/mem/oom/oom04.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/testcases/kernel/mem/oom/oom04.c b/testcases/kernel/mem/oom/oom04.c index ad39f7e77..d27d9d9e7 100644 --- a/testcases/kernel/mem/oom/oom04.c +++ b/testcases/kernel/mem/oom/oom04.c @@ -65,9 +65,6 @@ static void setup(void) if (!is_numa(NULL, NH_MEMS, 1)) tst_brk(TCONF, "requires NUMA with at least 1 node"); - overcommit = get_sys_tune("overcommit_memory"); - set_sys_tune("overcommit_memory", 1, 1); - /* * Some nodes do not contain memory, so use * get_allowed_nodes(NH_MEMS) to get a memory @@ -82,20 +79,17 @@ static void setup(void) SAFE_CG_PRINTF(tst_cg, "cgroup.procs", "%d", getpid()); } -static void cleanup(void) -{ - if (overcommit != -1) - set_sys_tune("overcommit_memory", overcommit, 0); -} - static struct tst_test test = { .needs_root = 1, .forks_child = 1, .max_runtime = TST_UNLIMITED_RUNTIME, .setup = setup, - .cleanup = cleanup, .test_all = verify_oom, .needs_cgroup_ctrls = (const char *const []){ "cpuset", NULL }, + .save_restore = (const struct tst_path_val[]) { + {"/proc/sys/vm/overcommit_memory", "1", TST_SR_TBROK}, + {} + }, }; #else |