]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/memfd: add memfd_create hugetlbfs selftest
authorMike Kravetz <mike.kravetz@oracle.com>
Wed, 6 Sep 2017 23:24:19 +0000 (16:24 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 6 Oct 2017 03:25:46 +0000 (20:25 -0700)
commitfa10b76d3c28fe7d087595a9345aac78bf2abaa9
tree621a1ebf9c487def2c492052fb89ee72b94f6afe
parenta2cc8b2eb8eca0abc3e484257f060f89177a0e82
selftests/memfd: add memfd_create hugetlbfs selftest

Orabug: 26768367

With the addition of hugetlbfs support in memfd_create, the memfd
selftests should verify correct functionality with hugetlbfs.

Instead of writing a separate memfd hugetlbfs test, modify the
memfd_test program to take an optional argument 'hugetlbfs'.  If the
hugetlbfs argument is specified, basic memfd_create functionality will
be exercised on hugetlbfs.  If hugetlbfs is not specified, the current
functionality of the test is unchanged.

Note that many of the tests in memfd_test test file sealing operations.
hugetlbfs does not support file sealing, therefore for hugetlbfs all
sealing related tests are skipped.

In order to test on hugetlbfs, there needs to be preallocated huge
pages.  A new script (run_tests) is added.  This script will first run
the existing memfd_create tests.  It will then, attempt to allocate the
required number of huge pages before running the hugetlbfs test.  At the
end of testing, it will release any huge pages allocated for testing
purposes.

Link: http://lkml.kernel.org/r/1502495772-24736-3-git-send-email-mike.kravetz@oracle.com
Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 1f522a4856600ac579765b729178f2b3b6a69129)
Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
Conflicts:
tools/testing/selftests/memfd/Makefile
tools/testing/selftests/memfd/Makefile
tools/testing/selftests/memfd/memfd_test.c
tools/testing/selftests/memfd/run_tests.sh [new file with mode: 0644]