<div dir="ltr">Hi,<br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 16, 2015 at 1:06 PM, Wanlong Gao <span dir="ltr"><<a href="mailto:wanlong.gao@gmail.com" target="_blank">wanlong.gao@gmail.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"><span class="">On Sun, Nov 15, 2015 at 04:41:00PM +0800, Li Wang wrote:<br>
> Testcase fails on system which not support hugepages:<br>
><br>
> futex_wake04    1  TBROK  :  safe_file_ops.c:155: The FILE '/proc/sys/vm/nr_hugepages' ended prematurely at futex_wake04.c:74<br>
> futex_wake04    2  TBROK  :  safe_file_ops.c:155: Remaining cases broken<br>
><br>
> Skip the testcase cases with TCONF rather than failing with TBROK.<br>
><br>
> Signed-off-by: Li Wang <<a href="mailto:liwang@redhat.com">liwang@redhat.com</a>><br>
> ---<br>
>  testcases/kernel/syscalls/futex/futex_wake04.c | 4 ++++<br>
>  1 file changed, 4 insertions(+)<br>
><br>
> diff --git a/testcases/kernel/syscalls/futex/futex_wake04.c b/testcases/kernel/syscalls/futex/futex_wake04.c<br>
> index dcefde8..2d6bd4c 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_SYS_HUGEPAGES "/sys/kernel/mm/hugepages/"<br>
<br>
</span>Why not use the original "/proc/sys/vm/nr_hugepages" to check the hugetlb<br>
support but add a new one ?<br></blockquote><div><br></div><div>In my test system, there exist file "/proc/sys/vm/nr_hugepages" with normal permission, but reject any R/W operation.<br><br></div><div>So, if I use   if (access(PATH_NR_HUGEPAGES, F_OK) == -1),  It doesn't work.<br></div><div><br># ll /proc/sys/vm/nr_hugepages<br>-rw-r--r--. 1 root root 0 Nov 15 09:03 /proc/sys/vm/nr_hugepages<br><br># cat /proc/sys/vm/nr_hugepages<br>cat: write error: Bad address<br><br># cat /proc/meminfo <br>MemTotal:        8663296 kB<br>MemFree:         6637056 kB<br>MemAvailable:    8151744 kB<br>Buffers:            4160 kB<br>Cached:          1504192 kB<br>SwapCached:            0 kB<br>Active:           946816 kB<br>Inactive:         788480 kB<br>Active(anon):     230592 kB<br>Inactive(anon):     9472 kB<br>Active(file):     716224 kB<br>Inactive(file):   779008 kB<br>Unevictable:           0 kB<br>Mlocked:               0 kB<br>SwapTotal:       4652992 kB<br>SwapFree:        4652992 kB<br>Dirty:                 0 kB<br>Writeback:             0 kB<br>AnonPages:        226944 kB<br>Mapped:            51456 kB<br>Shmem:             13120 kB<br>Slab:             188032 kB<br>SReclaimable:      63232 kB<br>SUnreclaim:       124800 kB<br>KernelStack:        2944 kB<br>PageTables:         2176 kB<br>NFS_Unstable:          0 kB<br>Bounce:                0 kB<br>WritebackTmp:          0 kB<br>CommitLimit:     8984640 kB<br>Committed_AS:     464064 kB<br>VmallocTotal:   8589934592 kB<br>VmallocUsed:       53056 kB<br>VmallocChunk:   8589850624 kB<br>HardwareCorrupted:     0 kB<br>AnonHugePages:         0 kB<br><br clear="all"></div></div><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>