* [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
* [LTP] [PATCH] mem/oom: fork may fail before test
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
0 siblings, 1 reply; 3+ messages in thread
From: Cyril Hrubis @ 2016-05-23 14:36 UTC (permalink / raw)
To: ltp
Hi!
> 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).
Looks good to me, acked.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 3+ messages in thread
* [LTP] [PATCH] mem/oom: fork may fail before test
2016-05-23 14:36 ` Cyril Hrubis
@ 2016-05-23 14:59 ` Jan Stancek
0 siblings, 0 replies; 3+ messages in thread
From: Jan Stancek @ 2016-05-23 14:59 UTC (permalink / raw)
To: ltp
----- Original Message -----
> From: "Cyril Hrubis" <chrubis@suse.cz>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: ltp@lists.linux.it
> Sent: Monday, 23 May, 2016 4:36:11 PM
> Subject: Re: [LTP] [PATCH] mem/oom: fork may fail before test
>
> Hi!
> > 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).
>
> Looks good to me, acked.
Pushed.
Regards,
Jan
>
> --
> Cyril Hrubis
> chrubis@suse.cz
>
^ permalink raw reply [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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox