[LTP] [PATCH v4] Test for memfd_create() syscall with MFD_HUGETLB flag.

Jan Stancek jstancek@redhat.com
Wed Aug 8 13:06:05 CEST 2018



----- Original Message -----
> 
> * memfd_create03: Tests the syscall for the flag MFD_HUGETLB.
> 
> * memfd_create04: Tests the syscall for the flags MFD_HUGE_2MB,
>                   MFD_HUGE_1GB,... used in conjunction with
>                   MFD_HUGETLB flag.
> 
> -- major changes from v3 to v4 --
> 
> * memfd_create03:
> 
> ** OR TERRNO with TFAIL for debugging purpose.
> 
> ** Move helper functions from memfd_create_hugetlb.c to the
>    main test code.
> 
> * memfd_create04:
> 
> ** Replace huge pages support check using procfs with sysfs.

Hi,

+1 for making it simpler (code has been reduced by ~33%).

There is a small problem with setup() in memfd_create03:
# ./memfd_create03
tst_test.c:1017: INFO: Timeout per run is 0h 05m 00s
safe_file_ops.c:220: BROK: Expected 1 conversions got 0 at memfd_create03.c:211

We should check also that "/sys/kernel/mm/hugepages" exists.
"/proc/sys/vm/nr_hugepages" exists even on systems which do not support huge pages.
# cat /proc/sys/vm/nr_hugepages
cat: /proc/sys/vm/nr_hugepages: Operation not supported

memfd_create04 is checking for it already, and reports TCONF.

---

Other than that v4 looks OK to me. I'm still looking at
testing it on aarch64.

Regards,
Jan


More information about the ltp mailing list