From bd67d5c15cc190f52eb2f2a2f6f6b800ca33d9dd Mon Sep 17 00:00:00 2001 From: Sri Jayaramappa Date: Thu, 23 Apr 2015 14:21:41 -0400 Subject: Test compaction of mlocked memory Commit commit 5bbe3547aa3b ("mm: allow compaction of unevictable pages") introduced a sysctl that allows userspace to enable scanning of locked pages for compaction. This patch introduces a new test which fragments main memory and attempts to allocate a number of huge pages to exercise this compaction logic. Tested on machines with up to 32 GB RAM. With the patch a much larger number of huge pages can be allocated than on the kernel without the patch. Example output: On a machine with 16 GB RAM: sudo make run_tests vm ... ----------------------- running compaction_test ----------------------- No of huge pages allocated = 3834 [PASS] ... Signed-off-by: Sri Jayaramappa Cc: linux-kernel@vger.kernel.org Cc: linux-api@vger.kernel.org Cc: Andrew Morton Cc: Eric B Munson Reviewed-by: Eric B Munson Acked-by: Andrew Morton Signed-off-by: Shuah Khan --- tools/testing/selftests/vm/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tools/testing/selftests/vm/Makefile') diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile index a5ce9534eb15..231b9a031f6a 100644 --- a/tools/testing/selftests/vm/Makefile +++ b/tools/testing/selftests/vm/Makefile @@ -1,7 +1,12 @@ # Makefile for vm selftests CFLAGS = -Wall -BINARIES = hugepage-mmap hugepage-shm map_hugetlb thuge-gen hugetlbfstest +BINARIES = compaction_test +BINARIES += hugepage-mmap +BINARIES += hugepage-shm +BINARIES += hugetlbfstest +BINARIES += map_hugetlb +BINARIES += thuge-gen BINARIES += transhuge-stress all: $(BINARIES) -- cgit v1.2.3