public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Li Wang <liwang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] mem/oom: do cleanup work for oom0{3,4,5}
Date: Fri, 29 Jan 2016 21:36:13 +0800	[thread overview]
Message-ID: <1454074573-5205-1-git-send-email-liwang@redhat.com> (raw)

oom03 should not test on aarch64 system which does not support NUMA, so I add
the function to make sure it could be skiped.
-----
  # ./oom03
  oom03       0  TINFO  :  set overcommit_memory to 1
  ...
  oom03       0  TINFO  :  expected victim is 29154.
  oom03       6  TPASS  :  victim signalled: (9) SIGKILL
  oom03       7  TCONF  :  numa_helper.c:86: syscall(236) __NR_get_mempolicy not supported on your arch
  oom03       8  TCONF  :  numa_helper.c:86: Remaining cases not appropriate for configuration

oom0{4,5} get fails on aarch64 system if run it in continuous twice(the
first time skiped with TCONF, then the second time it will be failed).
-----
  # ./oom05
  oom05       0  TINFO  :  set overcommit_memory to 1
  oom05       1  TCONF  :  numa_helper.c:86: syscall(236) __NR_get_mempolicy not supported on your arch
  oom05       2  TCONF  :  numa_helper.c:86: Remaining cases not appropriate for configuration

  # ./oom05
  oom05       0  TINFO  :  set overcommit_memory to 1
  oom05       1  TBROK  :  mem.c:997: mkdir /dev/cgroup: errno=EEXIST(17): File exists
  oom05       2  TBROK  :  mem.c:997: Remaining cases broken
  oom05       0  TINFO  :  set overcommit_memory to 1

the reason is that it doesn't pass the cleanup to the tst_brkm() there.

Signed-off-by: Li Wang <liwang@redhat.com>
-----
---
 testcases/kernel/mem/oom/oom03.c | 3 +++
 testcases/kernel/mem/oom/oom04.c | 2 +-
 testcases/kernel/mem/oom/oom05.c | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/mem/oom/oom03.c b/testcases/kernel/mem/oom/oom03.c
index 3afc3de..eabaeb9 100644
--- a/testcases/kernel/mem/oom/oom03.c
+++ b/testcases/kernel/mem/oom/oom03.c
@@ -94,6 +94,9 @@ void setup(void)
 	tst_sig(FORK, DEF_HANDLER, cleanup);
 	TEST_PAUSE;
 
+	if (!is_numa(NULL))
+		tst_brkm(TCONF, NULL, "The case need a NUMA system.");
+
 	overcommit = get_sys_tune("overcommit_memory");
 	set_sys_tune("overcommit_memory", 1, 1);
 	mount_mem("memcg", "cgroup", "memory", MEMCG_PATH, MEMCG_PATH_NEW);
diff --git a/testcases/kernel/mem/oom/oom04.c b/testcases/kernel/mem/oom/oom04.c
index ffb5503..0a315e1 100644
--- a/testcases/kernel/mem/oom/oom04.c
+++ b/testcases/kernel/mem/oom/oom04.c
@@ -100,7 +100,7 @@ void setup(void)
 	 */
 	ret = get_allowed_nodes(NH_MEMS, 1, &memnode);
 	if (ret < 0)
-		tst_brkm(TBROK, NULL, "Failed to get a memory node "
+		tst_brkm(TBROK, cleanup, "Failed to get a memory node "
 				      "using get_allowed_nodes()");
 	write_cpusets(memnode);
 }
diff --git a/testcases/kernel/mem/oom/oom05.c b/testcases/kernel/mem/oom/oom05.c
index 9cd49a7..44a243e 100644
--- a/testcases/kernel/mem/oom/oom05.c
+++ b/testcases/kernel/mem/oom/oom05.c
@@ -125,7 +125,7 @@ void setup(void)
 	 */
 	ret = get_allowed_nodes(NH_MEMS, 1, &memnode);
 	if (ret < 0)
-		tst_brkm(TBROK, NULL, "Failed to get a memory node "
+		tst_brkm(TBROK, cleanup, "Failed to get a memory node "
 				      "using get_allowed_nodes()");
 	write_cpusets(memnode);
 }
-- 
1.9.3


             reply	other threads:[~2016-01-29 13:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-29 13:36 Li Wang [this message]
2016-02-17  1:51 ` [LTP] [PATCH] mem/oom: do cleanup work for oom0{3,4,5} Li Wang
2016-02-19 12:18   ` Jan Stancek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1454074573-5205-1-git-send-email-liwang@redhat.com \
    --to=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox