All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] mem/oom: fork may fail before test
@ 2016-05-19 14:58 Jan Stancek
  2016-05-23 14:36 ` Cyril Hrubis
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Stancek @ 2016-05-19 14:58 UTC (permalink / raw)
  To: ltp

On systems with small RAM and vm.overcommit_memory == 2,
the system may already be in state where Committed_AS is
larger than CommitLimit due to various backround daemons
(NM, tuned, polkitd,...) asking for big allocations.

In such instances oom testcases report TBROK on very first fork.
This patch allows this to be a valid outcome (TPASS).

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 testcases/kernel/mem/lib/mem.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c
index c55a55d57915..3d853a393d28 100644
--- a/testcases/kernel/mem/lib/mem.c
+++ b/testcases/kernel/mem/lib/mem.c
@@ -127,6 +127,10 @@ void oom(int testcase, int lite, int retcode, int allow_sigkill)
 
 	switch (pid = fork()) {
 	case -1:
+		if (errno == retcode) {
+			tst_resm(TPASS | TERRNO, "fork");
+			return;
+		}
 		tst_brkm(TBROK | TERRNO, cleanup, "fork");
 	case 0:
 		threads = MAX(1, tst_ncpus() - 1);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-23 14:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-19 14:58 [LTP] [PATCH] mem/oom: fork may fail before test Jan Stancek
2016-05-23 14:36 ` Cyril Hrubis
2016-05-23 14:59   ` Jan Stancek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.