Skip to contentSkip to conversation

lib: use TCONF if hpage reserve failed in retry

PATCH New Li Wang 2 participants 3 messages May 26, 2020 Library code

lore
Share & tools
lore

Li Wang

author
#0 lore raw

PATCH 1/1 lib: use TCONF if hpage reserve failed in retry

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.

Cc Jan Stancek <[email protected]>
---
 lib/tst_hugepage.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
lib/tst_hugepage.c +3 -1
index 52667a14e..f2bf5d20e 100644
@@ -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:
Signature · 1 line
2.21.1
#1 lore raw

PATCH 1/1 lib: use TCONF if hpage reserve failed in retry

----- Original Message -----

Quoted 11 lines

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.

Cc Jan Stancek <[email protected]>
author
#2 lore raw

PATCH 1/1 lib: use TCONF if hpage reserve failed in retry

Quoted 8 lines · Jan Stancek

----- Original Message -----

Quoted 5 lines

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

Quoted 9 lines
Quoted 6 lines

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.

Cc Jan Stancek <[email protected]>

Pushed, thanks for the review.

Signature · 5 lines
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200526/d7090e1a/attachment-0001.htm>