Skip to content

Commit 5dcf52e

Browse files
broonieakpm00
authored andcommitted
selftests/mm: fix check for running THP tests
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]>
1 parent 6d7bc93 commit 5dcf52e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/mm/run_vmtests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ run_test() {
220220
if test_selected ${CATEGORY}; then
221221
# On memory constrainted systems some tests can fail to allocate hugepages.
222222
# perform some cleanup before the test for a higher success rate.
223-
if [ ${CATEGORY} == "thp" ] | [ ${CATEGORY} == "hugetlb" ]; then
223+
if [ ${CATEGORY} == "thp" -o ${CATEGORY} == "hugetlb" ]; then
224224
echo 3 > /proc/sys/vm/drop_caches
225225
sleep 2
226226
echo 1 > /proc/sys/vm/compact_memory

0 commit comments

Comments
 (0)