Skip to content

Commit

Permalink
selftests/mm: set overcommit_policy as OVERCOMMIT_ALWAYS
Browse files Browse the repository at this point in the history
The kernel's default behaviour is to obstruct the allocation of high
virtual address as it handles memory overcommit in a heuristic manner. 
Setting the parameter as OVERCOMMIT_ALWAYS, ensures kernel isn't
susceptible to the availability of a platform's physical memory when
denying a memory allocation request.

Link: https://lkml.kernel.org/r/20230323060121.1175830-4-chaitanyas.prakash@arm.com
Signed-off-by: Chaitanya S Prakash <chaitanyas.prakash@arm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Chaitanya S Prakash authored and Andrew Morton committed Apr 6, 2023
1 parent 3f9bea2 commit d6c2789
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tools/testing/selftests/mm/run_vmtests.sh
Original file line number Diff line number Diff line change
@@ -220,7 +220,15 @@ CATEGORY="mremap" run_test ./mremap_test
CATEGORY="hugetlb" run_test ./thuge-gen

if [ $VADDR64 -ne 0 ]; then

# set overcommit_policy as OVERCOMMIT_ALWAYS so that kernel
# allows high virtual address allocation requests independent
# of platform's physical memory.

prev_policy=$(cat /proc/sys/vm/overcommit_memory)
echo 1 > /proc/sys/vm/overcommit_memory
CATEGORY="hugevm" run_test ./virtual_address_range
echo $prev_policy > /proc/sys/vm/overcommit_memory

# virtual address 128TB switch test
CATEGORY="hugevm" run_test ./va_128TBswitch.sh

0 comments on commit d6c2789

Please sign in to comment.