Skip to contentSkip to conversation

mem/thp: skip thp02/thp03 if system not support hugepage

PATCH In review Li Wang 2 participants 3 messages Aug 13, 2015

lore
Share & tools
lore

Li Wang

author
#0 lore raw

PATCH 1/1 mem/thp: skip thp02/thp03 if system not support hugepage

Sometimes we get fails on system which not support hugepage:

thp02       1  TBROK  :  mem.c:1035: cannot find "Hugepagesize:" in /proc/meminfo
thp02       2  TBROK  :  mem.c:1035: Remaining cases broken
thp03       1  TBROK  :  mem.c:1035: cannot find "Hugepagesize:" in /proc/meminfo
thp03       2  TBROK  :  mem.c:1035: Remaining cases broken

Maybe skip the cases are better than TBROK them.

---
 testcases/kernel/mem/thp/thp02.c | 3 +++
 testcases/kernel/mem/thp/thp03.c | 3 +++
 2 files changed, 6 insertions(+)
testcases/kernel/mem/thp/thp02.c +3 -0
index 1470ae6..41d9192 100644
@@ -121,6 +121,9 @@ static void do_mremap(void)
 
 void setup(void)
 {
+	if (access(PATH_THP, F_OK) == -1)
+		tst_brkm(TCONF, NULL, "THP is not enabled");
+
 	tst_sig(FORK, DEF_HANDLER, cleanup);
 	TEST_PAUSE;
 
testcases/kernel/mem/thp/thp03.c +3 -0
index 8f62d0c..42f9025 100644
@@ -113,6 +113,9 @@ static void thp_test(void)
 
 void setup(void)
 {
+	if (access(PATH_THP, F_OK) == -1)
+		tst_brkm(TCONF, NULL, "THP is not enabled");
+
 	hugepage_size = read_meminfo("Hugepagesize:") * KB;
 	unaligned_size = hugepage_size * 4 - 1;
 	page_size = SAFE_SYSCONF(NULL, _SC_PAGESIZE);
Signature · 8 lines
1.8.3.1


------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
author
#1 lore raw

Hi,

Quoted 6 lines · Li Wang

Sometimes we get fails on system which not support hugepage:

thp02 1 TBROK : mem.c:1035: cannot find "Hugepagesize:" in
/proc/meminfo
thp02 2 TBROK : mem.c:1035: Remaining cases broken

Quoted 6 lines

thp03 1 TBROK : mem.c:1035: cannot find "Hugepagesize:" in
/proc/meminfo
thp03 2 TBROK : mem.c:1035: Remaining cases broken

Maybe skip the cases are better than TBROK them.

After thinking over this patch, I feel the subject is not good to explain, to be precisely,

"mem/thp: skip the case thp02/thp03 if THP is disable" is better than previous.

Since this regression case should rely on the THP enable but hupepage.

Quoted 48 lines
---
 testcases/kernel/mem/thp/thp02.c | 3 +++
 testcases/kernel/mem/thp/thp03.c | 3 +++
 2 files changed, 6 insertions(+)
testcases/kernel/mem/thp/thp02.c +3 -0
index 1470ae6..41d9192 100644
@@ -121,6 +121,9 @@ static void do_mremap(void)
 
 void setup(void)
 {
+       if (access(PATH_THP, F_OK) == -1)
+               tst_brkm(TCONF, NULL, "THP is not enabled");
+
        tst_sig(FORK, DEF_HANDLER, cleanup);
        TEST_PAUSE;
 
testcases/kernel/mem/thp/thp03.c +3 -1
index 8f62d0c..42f9025 100644
@@ -113,6 +113,9 @@ static void thp_test(void)
 
 void setup(void)
 {
+       if (access(PATH_THP, F_OK) == -1)
+               tst_brkm(TCONF, NULL, "THP is not enabled");
+
        hugepage_size = read_meminfo("Hugepagesize:") * KB;
        unaligned_size = hugepage_size * 4 - 1;
        page_size = SAFE_SYSCONF(NULL, _SC_PAGESIZE);
--

1.8.3.1

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Signature · 3 lines
Regards,
Li Wang
Email: [email protected]

------------------------------------------------------------------------------

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw
In reply to Li Wang

Hi!
I've reworded the commit message and the TCONF message a bit and pushed, thanks.

Signature · 8 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list