diff mbox series

[V2,4/4] selftests/mm: skip virtual_address_range tests on riscv

Message ID 20241008094141.549248-5-zhangchunyan@iscas.ac.cn (mailing list archive)
State New
Headers show
Series A few fixes for RISC-V | expand

Checks

Context Check Description
conchuod/vmtest-for-next-PR success PR summary
conchuod/patch-4-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh took 99.69s
conchuod/patch-4-test-2 success .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh took 935.46s
conchuod/patch-4-test-3 success .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh took 1117.92s
conchuod/patch-4-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh took 16.24s
conchuod/patch-4-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh took 17.70s
conchuod/patch-4-test-6 success .github/scripts/patches/tests/checkpatch.sh took 0.50s
conchuod/patch-4-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh took 35.52s
conchuod/patch-4-test-8 success .github/scripts/patches/tests/header_inline.sh took 0.00s
conchuod/patch-4-test-9 success .github/scripts/patches/tests/kdoc.sh took 0.46s
conchuod/patch-4-test-10 success .github/scripts/patches/tests/module_param.sh took 0.01s
conchuod/patch-4-test-11 success .github/scripts/patches/tests/verify_fixes.sh took 0.00s
conchuod/patch-4-test-12 success .github/scripts/patches/tests/verify_signedoff.sh took 0.02s

Commit Message

Chunyan Zhang Oct. 8, 2024, 9:41 a.m. UTC
RISC-V doesn't currently have the behavior of restricting the virtual
address space which virtual_address_range tests check, this will
cause the tests fail. So lets disable the whole test suite for riscv64
for now, not build it and run_vmtests.sh will skip it if it is not present.

Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
Signed-off-by: Chunyan Zhang <zhangchunyan@iscas.ac.cn>
---
V1: https://lore.kernel.org/linux-mm/ZuOuedBpS7i3T%2Fo0@ghost/T/
---
 tools/testing/selftests/mm/Makefile       |  2 ++
 tools/testing/selftests/mm/run_vmtests.sh | 10 ++++++----
 2 files changed, 8 insertions(+), 4 deletions(-)

Comments

Palmer Dabbelt Oct. 24, 2024, 6 p.m. UTC | #1
On Tue, 08 Oct 2024 02:41:41 PDT (-0700), zhangchunyan@iscas.ac.cn wrote:
> RISC-V doesn't currently have the behavior of restricting the virtual
> address space which virtual_address_range tests check, this will
> cause the tests fail. So lets disable the whole test suite for riscv64
> for now, not build it and run_vmtests.sh will skip it if it is not present.
>
> Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
> Signed-off-by: Chunyan Zhang <zhangchunyan@iscas.ac.cn>
> ---
> V1: https://lore.kernel.org/linux-mm/ZuOuedBpS7i3T%2Fo0@ghost/T/
> ---
>  tools/testing/selftests/mm/Makefile       |  2 ++
>  tools/testing/selftests/mm/run_vmtests.sh | 10 ++++++----
>  2 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile
> index 02e1204971b0..76a378c5c141 100644
> --- a/tools/testing/selftests/mm/Makefile
> +++ b/tools/testing/selftests/mm/Makefile
> @@ -115,7 +115,9 @@ endif
>
>  ifneq (,$(filter $(ARCH),arm64 mips64 parisc64 powerpc riscv64 s390x sparc64 x86_64 s390))
>  TEST_GEN_FILES += va_high_addr_switch
> +ifneq ($(ARCH),riscv64)
>  TEST_GEN_FILES += virtual_address_range
> +endif
>  TEST_GEN_FILES += write_to_hugetlbfs
>  endif
>
> diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh
> index c5797ad1d37b..4493bfd1911c 100755
> --- a/tools/testing/selftests/mm/run_vmtests.sh
> +++ b/tools/testing/selftests/mm/run_vmtests.sh
> @@ -347,10 +347,12 @@ if [ $VADDR64 -ne 0 ]; then
>  	# 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
> +	if [ -x ./virtual_address_range ]; then
> +		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
> +	fi
>
>  	# va high address boundary switch test
>  	ARCH_ARM64="arm64"

Acked-by: Palmer Dabbelt <palmer@rivosinc.com>

(I'm taking the first two as they're RISC-V bits)
Chunyan Zhang Oct. 29, 2024, 8:05 a.m. UTC | #2
Hi Andrew,

On Fri, 25 Oct 2024 at 02:00, Palmer Dabbelt <palmer@dabbelt.com> wrote:
>
> On Tue, 08 Oct 2024 02:41:41 PDT (-0700), zhangchunyan@iscas.ac.cn wrote:
> > RISC-V doesn't currently have the behavior of restricting the virtual
> > address space which virtual_address_range tests check, this will
> > cause the tests fail. So lets disable the whole test suite for riscv64
> > for now, not build it and run_vmtests.sh will skip it if it is not present.
> >
> > Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
> > Signed-off-by: Chunyan Zhang <zhangchunyan@iscas.ac.cn>
> > ---
> > V1: https://lore.kernel.org/linux-mm/ZuOuedBpS7i3T%2Fo0@ghost/T/
> > ---
> >  tools/testing/selftests/mm/Makefile       |  2 ++
> >  tools/testing/selftests/mm/run_vmtests.sh | 10 ++++++----
> >  2 files changed, 8 insertions(+), 4 deletions(-)
> >
> > diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile
> > index 02e1204971b0..76a378c5c141 100644
> > --- a/tools/testing/selftests/mm/Makefile
> > +++ b/tools/testing/selftests/mm/Makefile
> > @@ -115,7 +115,9 @@ endif
> >
> >  ifneq (,$(filter $(ARCH),arm64 mips64 parisc64 powerpc riscv64 s390x sparc64 x86_64 s390))
> >  TEST_GEN_FILES += va_high_addr_switch
> > +ifneq ($(ARCH),riscv64)
> >  TEST_GEN_FILES += virtual_address_range
> > +endif
> >  TEST_GEN_FILES += write_to_hugetlbfs
> >  endif
> >
> > diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh
> > index c5797ad1d37b..4493bfd1911c 100755
> > --- a/tools/testing/selftests/mm/run_vmtests.sh
> > +++ b/tools/testing/selftests/mm/run_vmtests.sh
> > @@ -347,10 +347,12 @@ if [ $VADDR64 -ne 0 ]; then
> >       # 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
> > +     if [ -x ./virtual_address_range ]; then
> > +             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
> > +     fi
> >
> >       # va high address boundary switch test
> >       ARCH_ARM64="arm64"
>
> Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
>
> (I'm taking the first two as they're RISC-V bits)

Could you please pick up the last two through your tree?

Thanks,
Chunyan
diff mbox series

Patch

diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile
index 02e1204971b0..76a378c5c141 100644
--- a/tools/testing/selftests/mm/Makefile
+++ b/tools/testing/selftests/mm/Makefile
@@ -115,7 +115,9 @@  endif
 
 ifneq (,$(filter $(ARCH),arm64 mips64 parisc64 powerpc riscv64 s390x sparc64 x86_64 s390))
 TEST_GEN_FILES += va_high_addr_switch
+ifneq ($(ARCH),riscv64)
 TEST_GEN_FILES += virtual_address_range
+endif
 TEST_GEN_FILES += write_to_hugetlbfs
 endif
 
diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh
index c5797ad1d37b..4493bfd1911c 100755
--- a/tools/testing/selftests/mm/run_vmtests.sh
+++ b/tools/testing/selftests/mm/run_vmtests.sh
@@ -347,10 +347,12 @@  if [ $VADDR64 -ne 0 ]; then
 	# 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
+	if [ -x ./virtual_address_range ]; then
+		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
+	fi
 
 	# va high address boundary switch test
 	ARCH_ARM64="arm64"