Skip to content

Commit

Permalink
selftests: vm: add tests for lock on fault
Browse files Browse the repository at this point in the history
Test the mmap() flag, and the mlockall() flag.  These tests ensure that
pages are not faulted in until they are accessed, that the pages are
unevictable once faulted in, and that VMA splitting and merging works with
the new VM flag.  The second test ensures that mlock limits are respected.
 Note that the limit test needs to be run a normal user.

Also add tests to use the new mlock2 family of system calls.

[[email protected]: : Fix mlock2-tests for 32-bit architectures]
[[email protected]: ensure the mlock2 syscall number can be found]
[[email protected]: use the right arguments for main()]
Signed-off-by: Eric B Munson <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Guenter Roeck <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: Kirill A. Shutemov <[email protected]>
Cc: Michael Kerrisk <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Stephen Rothwell <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Eric B Munson authored and torvalds committed Nov 6, 2015
1 parent b0f205c commit b3b0d09
Show file tree
Hide file tree
Showing 4 changed files with 807 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/testing/selftests/vm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ BINARIES = compaction_test
BINARIES += hugepage-mmap
BINARIES += hugepage-shm
BINARIES += map_hugetlb
BINARIES += mlock2-tests
BINARIES += on-fault-limit
BINARIES += thuge-gen
BINARIES += transhuge-stress
BINARIES += userfaultfd
Expand Down
Loading

0 comments on commit b3b0d09

Please sign in to comment.