Skip to content

Commit

Permalink
selftests/mm: fix check for running THP tests
Browse files Browse the repository at this point in the history
When testing if we should try to compact memory or drop caches before we
run the THP or HugeTLB tests we use | as an or operator.  This doesn't
work since run_vmtests.sh is written in shell where this is used to pipe
the output of the first argument into the second.  Instead use the shell's
-o operator.

Link: https://lkml.kernel.org/r/[email protected]
Fixes: b433ffa ("selftests: mm: perform some system cleanup before using hugepages")
Signed-off-by: Mark Brown <[email protected]>
Reviewed-by: Nico Pache <[email protected]>
Cc: Mariano Pache <[email protected]>
Cc: Shuah Khan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
broonie authored and akpm00 committed Feb 18, 2025
1 parent 6d7bc93 commit 5dcf52e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/mm/run_vmtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ run_test() {
if test_selected ${CATEGORY}; then
# On memory constrainted systems some tests can fail to allocate hugepages.
# perform some cleanup before the test for a higher success rate.
if [ ${CATEGORY} == "thp" ] | [ ${CATEGORY} == "hugetlb" ]; then
if [ ${CATEGORY} == "thp" -o ${CATEGORY} == "hugetlb" ]; then
echo 3 > /proc/sys/vm/drop_caches
sleep 2
echo 1 > /proc/sys/vm/compact_memory
Expand Down

0 comments on commit 5dcf52e

Please sign in to comment.