Skip to content

Commit 09fe1bd

Browse files
committed
selftests/mm: fix check for running THP tests
JIRA: https://issues.redhat.com/browse/RHEL-130531 commit 5dcf52e Author: Mark Brown <broonie@kernel.org> Date: Wed Feb 12 17:44:25 2025 +0000 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/20250212-kselftest-mm-no-hugepages-v1-1-44702f538522@kernel.org Fixes: b433ffa ("selftests: mm: perform some system cleanup before using hugepages") Signed-off-by: Mark Brown <broonie@kernel.org> Reviewed-by: Nico Pache <npache@redhat.com> Cc: Mariano Pache <npache@redhat.com> Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Chunyu Hu <chuhu@redhat.com>
1 parent 640a96c commit 09fe1bd

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
@@ -214,7 +214,7 @@ run_test() {
214214
if test_selected ${CATEGORY}; then
215215
# On memory constrainted systems some tests can fail to allocate hugepages.
216216
# perform some cleanup before the test for a higher success rate.
217-
if [ ${CATEGORY} == "thp" ] | [ ${CATEGORY} == "hugetlb" ]; then
217+
if [ ${CATEGORY} == "thp" -o ${CATEGORY} == "hugetlb" ]; then
218218
echo 3 > /proc/sys/vm/drop_caches
219219
sleep 2
220220
echo 1 > /proc/sys/vm/compact_memory

0 commit comments

Comments
 (0)