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: use TCONF if hpage reserve failed in retry
Date: Tue, 26 May 2020 15:09:01 +0800	[thread overview]
Message-ID: <20200526070901.12957-1-liwang@redhat.com> (raw)

Test still easy to get fail in?hpages?reserving (only 80% of
max_hpages) because of memory fragmentation.
 ?
  tst_hugepage.c:46: BROK: nr_hugepages = 171, but expect 255
? ?
But it seems unkind and useless to exit with TBROK when failed
in hpage reserve retrying. This patch proposes to use TCONF for
better log review.

Signed-off-by: Li Wang <liwang@redhat.com>
Cc: Jan Stancek <jstancek@redhat.com>
---
 lib/tst_hugepage.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/tst_hugepage.c b/lib/tst_hugepage.c
index 52667a14e..f2bf5d20e 100644
--- a/lib/tst_hugepage.c
+++ b/lib/tst_hugepage.c
@@ -43,7 +43,9 @@ unsigned long tst_request_hugepages(unsigned long hpages)
 	SAFE_FILE_PRINTF(PATH_NR_HPAGES, "%lu", tst_hugepages);
 	SAFE_FILE_SCANF(PATH_NR_HPAGES, "%lu", &val);
 	if (val != tst_hugepages)
-		tst_brk(TBROK, "nr_hugepages = %lu, but expect %lu", val, tst_hugepages);
+		tst_brk(TCONF, "nr_hugepages = %lu, but expect %lu. "
+				"Not enough hugepages for testing.",
+				val, tst_hugepages);
 
 	tst_res(TINFO, "%lu hugepage(s) reserved", tst_hugepages);
 out:
-- 
2.21.1


             reply	other threads:[~2020-05-26  7:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26  7:09 Li Wang [this message]
2020-05-26  8:58 ` [LTP] [PATCH] lib: use TCONF if hpage reserve failed in retry Jan Stancek
2020-05-26 10:23   ` 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=20200526070901.12957-1-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