* [LTP] [PATCH] mem/lib: Skip oom(KSM) if child_alloc() makes single TESTMEM+MB allocation
@ 2016-06-21 10:54 Li Wang
2016-06-21 11:19 ` Jan Stancek
0 siblings, 1 reply; 2+ messages in thread
From: Li Wang @ 2016-06-21 10:54 UTC (permalink / raw)
To: ltp
We occasionally catch errors like:
oom03 0 TINFO : start OOM testing for KSM pages.
oom03 0 TINFO : expected victim is 3490.
oom03 6 TFAIL : mem.c:163: victim unexpectedly ended with retcode: 0, expected: 12
oom03 0 TINFO : set overcommit_memory to 0
It cames from the caller testoom(0, 1, ENOMEM, 1). The issue was occurred
since child_alloc() go into single(lite == 1) thread mode but successfully
finish the memory(TESTMEM+MB) allocation and return 0. That's not what we
expected because oom03 has already set 'limit_in_byte = TESTMEM' in cgroup.
A probably reason is that KSM scan merged samepages and disturbed the OOM
test.
By this patch, Let's skip the oom(KSM) test in cgroup.
Signed-off-by: Li Wang <liwang@redhat.com>
---
testcases/kernel/mem/lib/mem.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c
index 3d853a3..10eb0f7 100644
--- a/testcases/kernel/mem/lib/mem.c
+++ b/testcases/kernel/mem/lib/mem.c
@@ -224,8 +224,10 @@ void testoom(int mempolicy, int lite, int retcode, int allow_sigkill)
tst_resm(TINFO, "start OOM testing for mlocked pages.");
oom(MLOCK, lite, retcode, allow_sigkill);
- if (access(PATH_KSM, F_OK) == -1) {
- tst_resm(TINFO, "KSM configuration is not enabled, "
+ /* Skip oom(KSM) if lite == 1, since limit_in_bytes may vary from
+ * run to run, which isn't reliable for oom03 cgroup test.*/
+ if (access(PATH_KSM, F_OK) == -1 || lite == 1) {
+ tst_resm(TINFO, "KSM is not configed or lite == 1, "
"skip OOM test for KSM pags");
} else {
tst_resm(TINFO, "start OOM testing for KSM pages.");
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [LTP] [PATCH] mem/lib: Skip oom(KSM) if child_alloc() makes single TESTMEM+MB allocation
2016-06-21 10:54 [LTP] [PATCH] mem/lib: Skip oom(KSM) if child_alloc() makes single TESTMEM+MB allocation Li Wang
@ 2016-06-21 11:19 ` Jan Stancek
0 siblings, 0 replies; 2+ messages in thread
From: Jan Stancek @ 2016-06-21 11:19 UTC (permalink / raw)
To: ltp
----- Original Message -----
> From: "Li Wang" <liwang@redhat.com>
> To: jstancek@redhat.com
> Cc: ltp@lists.linux.it
> Sent: Tuesday, 21 June, 2016 12:54:43 PM
> Subject: [PATCH] mem/lib: Skip oom(KSM) if child_alloc() makes single TESTMEM+MB allocation
>
I reworded the description a little and pushed.
Thanks,
Jan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-06-21 11:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-21 10:54 [LTP] [PATCH] mem/lib: Skip oom(KSM) if child_alloc() makes single TESTMEM+MB allocation Li Wang
2016-06-21 11:19 ` Jan Stancek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox