Skip to content
Commit bd67d5c1 authored by Sri Jayaramappa's avatar Sri Jayaramappa Committed by Shuah Khan
Browse files

Test compaction of mlocked memory

Commit commit 5bbe3547

 ("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: default avatarSri Jayaramappa <sjayaram@akamai.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-api@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Eric B Munson <emunson@akamai.com>
Reviewed-by: default avatarEric B Munson <emunson@akamai.com>
Acked-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
parent d0bd7f2a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment