<div dir="ltr">Hi,<br><div class="gmail_extra"><br></div><div class="gmail_extra">After thinking twice, I feel that coding like below are too fussy. Now I tend to create a new function as 'check_hugepage()' in mem.c. and then we just need to add oneline each testcae.<br><br>void check_hugepage(void)<br>{<br> if (access(PATH_HUGEPAGES, F_OK) == -1)<br> tst_brkm(TCONF, NULL, "Huge page is not supported.");<br>}<br> <br></div><div class="gmail_extra">Pls ignore this patch, let me post V2.<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 25, 2015 at 4:22 PM, Li Wang <span dir="ltr"><<a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi all, how about changging these codes in testcases to check if<br>
system support hugepage?<br>
<br>
Signed-off-by: Li Wang <<a href="mailto:liwang@redhat.com">liwang@redhat.com</a>><br>
---<br>
testcases/kernel/mem/hugetlb/hugemmap/hugemmap01.c | 4 ++++<br>
testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c | 4 ++++<br>
testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c | 4 ++++<br>
testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c | 28 ++++++++++++----------<br>
.../kernel/mem/hugetlb/hugeshmat/hugeshmat01.c | 3 +++<br>
.../kernel/mem/hugetlb/hugeshmat/hugeshmat02.c | 3 +++<br>
.../kernel/mem/hugetlb/hugeshmat/hugeshmat03.c | 3 +++<br>
.../kernel/mem/hugetlb/hugeshmat/hugeshmat04.c | 3 +++<br>
.../kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c | 3 +++<br>
.../kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c | 3 +++<br>
.../kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c | 3 +++<br>
.../kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c | 3 +++<br>
.../kernel/mem/hugetlb/hugeshmget/hugeshmget01.c | 3 +++<br>
.../kernel/mem/hugetlb/hugeshmget/hugeshmget02.c | 3 +++<br>
.../kernel/mem/hugetlb/hugeshmget/hugeshmget03.c | 3 +++<br>
.../kernel/mem/hugetlb/hugeshmget/hugeshmget05.c | 4 ++++<br>
testcases/kernel/mem/include/mem.h | 1 +<br>
testcases/kernel/syscalls/futex/futex_wake04.c | 4 ++++<br>
18 files changed, 69 insertions(+), 13 deletions(-)<br>
<br>
diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap01.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap01.c<br>
index 62c3cc8..cae0b78 100644<br>
--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap01.c<br>
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap01.c<br>
@@ -159,6 +159,10 @@ void setup(void)<br>
{<br>
TEST_PAUSE;<br>
tst_require_root();<br>
+<br>
+ if (access(PATH_HUGEPAGES, F_OK) == -1)<br>
+ tst_brkm(TCONF, NULL, "Huge page is not supported.");<br>
+<br>
if (mount("none", Hopt, "hugetlbfs", 0, NULL) < 0)<br>
tst_brkm(TBROK | TERRNO, NULL, "mount failed on %s", Hopt);<br>
<br>
diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c<br>
index 9fee330..1187b38 100644<br>
--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c<br>
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c<br>
@@ -93,6 +93,9 @@ int main(int ac, char **av)<br>
<br>
tst_parse_opts(ac, av, options, &help);<br>
<br>
+ if (access(PATH_HUGEPAGES, F_OK) == -1)<br>
+ tst_brkm(TCONF, NULL, "Huge page is not supported.");<br>
+<br>
if (!Hflag) {<br>
tst_tmpdir();<br>
Hopt = tst_get_tmpdir();<br>
@@ -200,6 +203,7 @@ void setup(void)<br>
{<br>
TEST_PAUSE;<br>
tst_require_root();<br>
+<br>
if (mount("none", Hopt, "hugetlbfs", 0, NULL) < 0)<br>
tst_brkm(TBROK | TERRNO, NULL, "mount failed on %s", Hopt);<br>
orig_hugepages = get_sys_tune("nr_hugepages");<br>
diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c<br>
index 727b102..0b7bc86 100644<br>
--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c<br>
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c<br>
@@ -175,6 +175,10 @@ void setup(void)<br>
{<br>
TEST_PAUSE;<br>
tst_require_root();<br>
+<br>
+ if (access(PATH_HUGEPAGES, F_OK) == -1)<br>
+ tst_brkm(TCONF, NULL, "Huge page is not supported.");<br>
+<br>
if (mount("none", Hopt, "hugetlbfs", 0, NULL) < 0)<br>
tst_brkm(TBROK | TERRNO, NULL, "mount failed on %s", Hopt);<br>
orig_hugepages = get_sys_tune("nr_hugepages");<br>
diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c<br>
index 8dac97a..7dcf87a 100644<br>
--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c<br>
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c<br>
@@ -48,6 +48,7 @@<br>
#include <string.h><br>
#include <ctype.h><br>
#include "test.h"<br>
+#include "mem.h"<br>
<br>
#define PROTECTION (PROT_READ | PROT_WRITE)<br>
#define PATH_MEMINFO "/proc/meminfo"<br>
@@ -97,9 +98,7 @@ static option_t options[] = {<br>
{NULL, NULL, NULL}<br>
};<br>
<br>
-static void setup(void);<br>
-static void cleanup(void);<br>
-static void overcommit(void);<br>
+static void overcommit1(void);<br>
static void write_bytes(void *addr);<br>
static void read_bytes(void *addr);<br>
static int lookup(char *line, char *pattern);<br>
@@ -132,13 +131,13 @@ int main(int argc, char *argv[])<br>
setup();<br>
for (lc = 0; TEST_LOOPING(lc); lc++) {<br>
tst_count = 0;<br>
- overcommit();<br>
+ overcommit1();<br>
}<br>
cleanup();<br>
tst_exit();<br>
}<br>
<br>
-static void overcommit(void)<br>
+static void overcommit1(void)<br>
{<br>
void *addr = NULL, *shmaddr = NULL;<br>
int fd = -1, key = -1;<br>
@@ -245,7 +244,7 @@ static void overcommit(void)<br>
}<br>
}<br>
<br>
-static void cleanup(void)<br>
+void cleanup(void)<br>
{<br>
int fd;<br>
<br>
@@ -253,7 +252,7 @@ static void cleanup(void)<br>
fd = open(PATH_SHMMAX, O_WRONLY);<br>
if (fd == -1)<br>
tst_resm(TWARN | TERRNO, "open");<br>
- if (write(fd, shmmax, strlen(shmmax)) != strlen(shmmax))<br>
+ if ((unsigned int)write(fd, shmmax, strlen(shmmax)) != strlen(shmmax))<br>
tst_resm(TWARN | TERRNO, "write");<br>
close(fd);<br>
}<br>
@@ -261,7 +260,7 @@ static void cleanup(void)<br>
if (fd == -1)<br>
tst_resm(TWARN | TERRNO, "open");<br>
tst_resm(TINFO, "restore nr_hugepages to %s.", nr_hugepages);<br>
- if (write(fd, nr_hugepages,<br>
+ if ((unsigned int)write(fd, nr_hugepages,<br>
strlen(nr_hugepages)) != strlen(nr_hugepages))<br>
tst_resm(TWARN | TERRNO, "write");<br>
close(fd);<br>
@@ -271,7 +270,7 @@ static void cleanup(void)<br>
tst_resm(TWARN | TERRNO, "open");<br>
tst_resm(TINFO, "restore nr_overcommit_hugepages to %s.",<br>
nr_overcommit_hugepages);<br>
- if (write(fd, nr_overcommit_hugepages, strlen(nr_overcommit_hugepages))<br>
+ if ((unsigned int)write(fd, nr_overcommit_hugepages, strlen(nr_overcommit_hugepages))<br>
!= strlen(nr_overcommit_hugepages))<br>
tst_resm(TWARN | TERRNO, "write");<br>
close(fd);<br>
@@ -287,7 +286,7 @@ static void cleanup(void)<br>
tst_rmdir();<br>
}<br>
<br>
-static void setup(void)<br>
+void setup(void)<br>
{<br>
FILE *fp;<br>
int fd;<br>
@@ -321,7 +320,7 @@ static void setup(void)<br>
tst_brkm(TBROK | TERRNO, cleanup, "open");<br>
snprintf(buf, BUFSIZ, "%ld",<br>
(long)(length / 2 * hugepagesize));<br>
- if (write(fd, buf, strlen(buf)) != strlen(buf))<br>
+ if ((unsigned int)write(fd, buf, strlen(buf)) != strlen(buf))<br>
tst_brkm(TBROK | TERRNO, cleanup,<br>
"failed to change shmmax.");<br>
}<br>
@@ -345,7 +344,7 @@ static void setup(void)<br>
if (lseek(fd, 0, SEEK_SET) == -1)<br>
tst_brkm(TBROK | TERRNO, cleanup, "lseek");<br>
snprintf(buf, BUFSIZ, "%zd", size);<br>
- if (write(fd, buf, strlen(buf)) != strlen(buf))<br>
+ if ((unsigned int)write(fd, buf, strlen(buf)) != strlen(buf))<br>
tst_brkm(TBROK | TERRNO, cleanup,<br>
"failed to change nr_hugepages.");<br>
close(fd);<br>
@@ -369,7 +368,7 @@ static void setup(void)<br>
if (lseek(fd, 0, SEEK_SET) == -1)<br>
tst_brkm(TBROK | TERRNO, cleanup, "lseek");<br>
snprintf(buf, BUFSIZ, "%zd", size);<br>
- if (write(fd, buf, strlen(buf)) != strlen(buf))<br>
+ if ((unsigned int)write(fd, buf, strlen(buf)) != strlen(buf))<br>
tst_brkm(TBROK | TERRNO, cleanup,<br>
"failed to change nr_hugepages.");<br>
close(fd);<br>
@@ -467,6 +466,9 @@ static void init_hugepagesize(void)<br>
{<br>
FILE *fp;<br>
<br>
+ if (access(PATH_HUGEPAGES, F_OK) == -1)<br>
+ tst_brkm(TCONF, NULL, "Huge page is not supported.");<br>
+<br>
memset(buf, -1, BUFSIZ);<br>
fp = fopen(PATH_MEMINFO, "r");<br>
if (fp == NULL)<br>
diff --git a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c<br>
index 851d4cf..31192c5 100644<br>
--- a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c<br>
+++ b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c<br>
@@ -212,6 +212,9 @@ void setup(void)<br>
tst_sig(NOFORK, DEF_HANDLER, cleanup);<br>
tst_tmpdir();<br>
<br>
+ if (access(PATH_HUGEPAGES, F_OK) == -1)<br>
+ tst_brkm(TCONF, NULL, "Huge page is not supported.");<br>
+<br>
orig_hugepages = get_sys_tune("nr_hugepages");<br>
set_sys_tune("nr_hugepages", hugepages, 1);<br>
hpage_size = read_meminfo("Hugepagesize:") * 1024;<br>
diff --git a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat02.c b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat02.c<br>
index 52348f1..0c809ea 100644<br>
--- a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat02.c<br>
+++ b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat02.c<br>
@@ -128,6 +128,9 @@ void setup(void)<br>
tst_sig(NOFORK, DEF_HANDLER, cleanup);<br>
tst_tmpdir();<br>
<br>
+ if (access(PATH_HUGEPAGES, F_OK) == -1)<br>
+ tst_brkm(TCONF, NULL, "Huge page is not supported.");<br>
+<br>
orig_hugepages = get_sys_tune("nr_hugepages");<br>
set_sys_tune("nr_hugepages", hugepages, 1);<br>
hpage_size = read_meminfo("Hugepagesize:") * 1024;<br>
diff --git a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c<br>
index 723c8b5..ba73ded 100644<br>
--- a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c<br>
+++ b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c<br>
@@ -134,6 +134,9 @@ void setup(void)<br>
tst_sig(FORK, DEF_HANDLER, cleanup);<br>
tst_tmpdir();<br>
<br>
+ if (access(PATH_HUGEPAGES, F_OK) == -1)<br>
+ tst_brkm(TCONF, NULL, "Huge page is not supported.");<br>
+<br>
orig_hugepages = get_sys_tune("nr_hugepages");<br>
set_sys_tune("nr_hugepages", hugepages, 1);<br>
hpage_size = read_meminfo("Hugepagesize:") * 1024;<br>
diff --git a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat04.c b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat04.c<br>
index f631a0a..8a7f88e 100644<br>
--- a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat04.c<br>
+++ b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat04.c<br>
@@ -127,6 +127,9 @@ void setup(void)<br>
<br>
tst_require_root();<br>
<br>
+ if (access(PATH_HUGEPAGES, F_OK) == -1)<br>
+ tst_brkm(TCONF, NULL, "Huge page is not supported.");<br>
+<br>
mem_total = read_meminfo("MemTotal:");<br>
SAFE_FILE_SCANF(NULL, PATH_SHMMAX, "%ld", &orig_shmmax);<br>
SAFE_FILE_PRINTF(NULL, PATH_SHMMAX, "%ld", (long)SIZE);<br>
diff --git a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c<br>
index 66ad1b5..ff04ca5 100644<br>
--- a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c<br>
+++ b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c<br>
@@ -395,6 +395,9 @@ void setup(void)<br>
tst_sig(FORK, sighandler, cleanup);<br>
tst_tmpdir();<br>
<br>
+ if (access(PATH_HUGEPAGES, F_OK) == -1)<br>
+ tst_brkm(TCONF, NULL, "Huge page is not supported.");<br>
+<br>
orig_hugepages = get_sys_tune("nr_hugepages");<br>
set_sys_tune("nr_hugepages", hugepages, 1);<br>
hpage_size = read_meminfo("Hugepagesize:") * 1024;<br>
diff --git a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c<br>
index 4aeb638..c085c09 100644<br>
--- a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c<br>
+++ b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c<br>
@@ -133,6 +133,9 @@ void setup(void)<br>
tst_sig(NOFORK, DEF_HANDLER, cleanup);<br>
tst_tmpdir();<br>
<br>
+ if (access(PATH_HUGEPAGES, F_OK) == -1)<br>
+ tst_brkm(TCONF, NULL, "Huge page is not supported.");<br>
+<br>
orig_hugepages = get_sys_tune("nr_hugepages");<br>
set_sys_tune("nr_hugepages", hugepages, 1);<br>
hpage_size = read_meminfo("Hugepagesize:") * 1024;<br>
diff --git a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c<br>
index 9f5c2c9..7f99acb 100644<br>
--- a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c<br>
+++ b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c<br>
@@ -159,6 +159,9 @@ void setup(void)<br>
tst_sig(FORK, DEF_HANDLER, cleanup);<br>
tst_tmpdir();<br>
<br>
+ if (access(PATH_HUGEPAGES, F_OK) == -1)<br>
+ tst_brkm(TCONF, NULL, "Huge page is not supported.");<br>
+<br>
orig_hugepages = get_sys_tune("nr_hugepages");<br>
set_sys_tune("nr_hugepages", hugepages, 1);<br>
hpage_size = read_meminfo("Hugepagesize:") * 1024;<br>
diff --git a/testcases/kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c b/testcases/kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c<br>
index 9770e87..7f775a4 100644<br>
--- a/testcases/kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c<br>
+++ b/testcases/kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c<br>
@@ -168,6 +168,9 @@ void setup(void)<br>
tst_sig(NOFORK, sighandler, cleanup);<br>
tst_tmpdir();<br>
<br>
+ if (access(PATH_HUGEPAGES, F_OK) == -1)<br>
+ tst_brkm(TCONF, NULL, "Huge page is not supported.");<br>
+<br>
orig_hugepages = get_sys_tune("nr_hugepages");<br>
set_sys_tune("nr_hugepages", hugepages, 1);<br>
hpage_size = read_meminfo("Hugepagesize:") * 1024;<br>
diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c<br>
index ee82de3..46e6949 100644<br>
--- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c<br>
+++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c<br>
@@ -146,6 +146,9 @@ void setup(void)<br>
tst_sig(NOFORK, DEF_HANDLER, cleanup);<br>
tst_tmpdir();<br>
<br>
+ if (access(PATH_HUGEPAGES, F_OK) == -1)<br>
+ tst_brkm(TCONF, NULL, "Huge page is not supported.");<br>
+<br>
orig_hugepages = get_sys_tune("nr_hugepages");<br>
set_sys_tune("nr_hugepages", hugepages, 1);<br>
hpage_size = read_meminfo("Hugepagesize:") * 1024;<br>
diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c<br>
index b995ef8..55bd860 100644<br>
--- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c<br>
+++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c<br>
@@ -141,6 +141,9 @@ void setup(void)<br>
tst_sig(NOFORK, DEF_HANDLER, cleanup);<br>
tst_tmpdir();<br>
<br>
+ if (access(PATH_HUGEPAGES, F_OK) == -1)<br>
+ tst_brkm(TCONF, NULL, "Huge page is not supported.");<br>
+<br>
orig_hugepages = get_sys_tune("nr_hugepages");<br>
set_sys_tune("nr_hugepages", hugepages, 1);<br>
hpage_size = read_meminfo("Hugepagesize:") * 1024;<br>
diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c<br>
index 9284669..8a69258 100644<br>
--- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c<br>
+++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c<br>
@@ -116,6 +116,9 @@ void setup(void)<br>
tst_sig(NOFORK, DEF_HANDLER, cleanup);<br>
tst_tmpdir();<br>
<br>
+ if (access(PATH_HUGEPAGES, F_OK) == -1)<br>
+ tst_brkm(TCONF, NULL, "Huge page is not supported.");<br>
+<br>
orig_hugepages = get_sys_tune("nr_hugepages");<br>
set_sys_tune("nr_hugepages", hugepages, 1);<br>
hpage_size = read_meminfo("Hugepagesize:") * 1024;<br>
diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c<br>
index 7b8f6b4..ff410e9 100644<br>
--- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c<br>
+++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c<br>
@@ -138,6 +138,10 @@ void setup(void)<br>
tst_sig(FORK, DEF_HANDLER, cleanup);<br>
tst_tmpdir();<br>
<br>
+<br>
+ if (access(PATH_HUGEPAGES, F_OK) == -1)<br>
+ tst_brkm(TCONF, NULL, "Huge page is not supported.");<br>
+<br>
orig_hugepages = get_sys_tune("nr_hugepages");<br>
set_sys_tune("nr_hugepages", hugepages, 1);<br>
hpage_size = read_meminfo("Hugepagesize:") * 1024;<br>
diff --git a/testcases/kernel/mem/include/mem.h b/testcases/kernel/mem/include/mem.h<br>
index 4a18799..b8a3d6f 100644<br>
--- a/testcases/kernel/mem/include/mem.h<br>
+++ b/testcases/kernel/mem/include/mem.h<br>
@@ -62,6 +62,7 @@ void thp_usage(void);<br>
/* HUGETLB */<br>
<br>
#define PATH_SHMMAX "/proc/sys/kernel/shmmax"<br>
+#define PATH_HUGEPAGES "/sys/kernel/mm/hugepages/"<br>
<br>
void write_memcg(void);<br>
void create_same_memory(int size, int num, int unit);<br>
diff --git a/testcases/kernel/syscalls/futex/futex_wake04.c b/testcases/kernel/syscalls/futex/futex_wake04.c<br>
index dcefde8..d044ba5 100644<br>
--- a/testcases/kernel/syscalls/futex/futex_wake04.c<br>
+++ b/testcases/kernel/syscalls/futex/futex_wake04.c<br>
@@ -50,6 +50,7 @@<br>
<br>
#define PATH_MEMINFO "/proc/meminfo"<br>
#define PATH_NR_HUGEPAGES "/proc/sys/vm/nr_hugepages"<br>
+#define PATH_HUGEPAGES "/sys/kernel/mm/hugepages/"<br>
<br>
const char *TCID = "futex_wake04";<br>
const int TST_TOTAL = 1;<br>
@@ -69,6 +70,9 @@ static void setup(void)<br>
"that are 2.6.32 or higher");<br>
}<br>
<br>
+ if (access(PATH_HUGEPAGES, F_OK) == -1)<br>
+ tst_brkm(TCONF, NULL, "Huge page is not supported.");<br>
+<br>
tst_tmpdir();<br>
<br>
SAFE_FILE_SCANF(NULL, PATH_NR_HUGEPAGES, "%ld", &orig_hugepages);<br>
<span class=""><font color="#888888">--<br>
1.8.3.1<br>
<br>
<br>
--<br>
Mailing list info: <a href="http://lists.linux.it/listinfo/ltp" rel="noreferrer" target="_blank">http://lists.linux.it/listinfo/ltp</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Regards,<br></div>Li Wang<br></div><div>Email: <a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.com</a><br></div></div></div></div></div></div>
</div></div>