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] lib/mem.c: exit from test_transparent_hugepage() if shortage of memory
Date: Tue, 26 Jan 2016 14:35:32 +0800	[thread overview]
Message-ID: <1453790132-2360-1-git-send-email-liwang@redhat.com> (raw)

Sometime thp05.c fails like:
---
thp05       0  TINFO  :  Stop all children...
thp05       0  TINFO  :  Start to scan all transparent hugepages...
thp05       0  TINFO  :  khugepaged daemon takes 10s to scan all thp pages
thp05       0  TINFO  :  Start to verify transparent hugepage size...
thp05       1  TFAIL  :  mem.c:754: child[27099] got 43008KB thps - expect 40960KB thps
thp05       2  TFAIL  :  mem.c:754: child[27099] got 43008KB thps - expect 40960KB thps
thp05       3  TFAIL  :  mem.c:754: child[27099] got 43008KB thps - expect 40960KB thps
thp05       4  TFAIL  :  mem.c:754: child[27099] got 43008KB thps - expect 40960KB thps
---

Since the system has done much testing work so far as it comes here, it is very easy to
hit the fails if the memory is fragmented, the following tests should better be skiped
while system dose not have enough memory for THP testing.

Signed-off-by: Li Wang <liwang@redhat.com>
---
 testcases/kernel/mem/lib/mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c
index cee4e91..6715c35 100644
--- a/testcases/kernel/mem/lib/mem.c
+++ b/testcases/kernel/mem/lib/mem.c
@@ -773,7 +773,7 @@ void test_transparent_hugepage(int nr_children, int nr_thps,
 	memfree = read_meminfo("MemFree:");
 	tst_resm(TINFO, "The current MemFree is %luMB", memfree / KB);
 	if (memfree < MB)
-		tst_resm(TCONF, "Not enough memory for testing");
+		tst_brkm(TCONF, NULL, "Not enough memory for testing");
 
 	hugepagesize = read_meminfo("Hugepagesize:");
 	tst_resm(TINFO, "The current Hugepagesize is %luMB", hugepagesize / KB);
-- 
1.8.3.1


             reply	other threads:[~2016-01-26  6:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26  6:35 Li Wang [this message]
2016-01-26  9:14 ` [LTP] [PATCH] lib/mem.c: exit from test_transparent_hugepage() if shortage of memory Li Wang
2016-01-26 10:17   ` Li Wang
2016-02-04 16:18     ` Cyril Hrubis
2016-01-26 11:11 ` Cyril Hrubis
2016-01-26 13:00   ` Li Wang

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=1453790132-2360-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