* [PATCH 1/2] selftest/mm: Fix typo in virtual_address_range
@ 2024-09-13 2:26 Chunyan Zhang
2024-09-13 2:26 ` [PATCH 2/2] selftests/mm: skip virtual_address_range tests on riscv Chunyan Zhang
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Chunyan Zhang @ 2024-09-13 2:26 UTC (permalink / raw)
To: Andrew Morton, Shuah Khan, Paul Walmsley, Palmer Dabbelt
Cc: Alexandre Ghiti, Charlie Jenkins, linux-mm, linux-kselftest,
linux-riscv, linux-kernel, Chunyan Zhang
The function name should be *hint* address, so correct it.
Signed-off-by: Chunyan Zhang <zhangchunyan@iscas.ac.cn>
---
tools/testing/selftests/mm/virtual_address_range.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/mm/virtual_address_range.c b/tools/testing/selftests/mm/virtual_address_range.c
index 4e4c1e311247..2a2b69e91950 100644
--- a/tools/testing/selftests/mm/virtual_address_range.c
+++ b/tools/testing/selftests/mm/virtual_address_range.c
@@ -64,7 +64,7 @@
#define NR_CHUNKS_HIGH NR_CHUNKS_384TB
#endif
-static char *hind_addr(void)
+static char *hint_addr(void)
{
int bits = HIGH_ADDR_SHIFT + rand() % (63 - HIGH_ADDR_SHIFT);
@@ -185,7 +185,7 @@ int main(int argc, char *argv[])
}
for (i = 0; i < NR_CHUNKS_HIGH; i++) {
- hint = hind_addr();
+ hint = hint_addr();
hptr[i] = mmap(hint, MAP_CHUNK_SIZE, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] selftests/mm: skip virtual_address_range tests on riscv
2024-09-13 2:26 [PATCH 1/2] selftest/mm: Fix typo in virtual_address_range Chunyan Zhang
@ 2024-09-13 2:26 ` Chunyan Zhang
2024-09-13 3:22 ` Charlie Jenkins
2024-09-13 3:16 ` [PATCH 1/2] selftest/mm: Fix typo in virtual_address_range Charlie Jenkins
2024-12-11 22:32 ` patchwork-bot+linux-riscv
2 siblings, 1 reply; 6+ messages in thread
From: Chunyan Zhang @ 2024-09-13 2:26 UTC (permalink / raw)
To: Andrew Morton, Shuah Khan, Paul Walmsley, Palmer Dabbelt
Cc: Alexandre Ghiti, Charlie Jenkins, linux-mm, linux-kselftest,
linux-riscv, linux-kernel, Chunyan Zhang
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.
Signed-off-by: Chunyan Zhang <zhangchunyan@iscas.ac.cn>
---
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 84573ddfcfa2..912778347213 100644
--- a/tools/testing/selftests/mm/Makefile
+++ b/tools/testing/selftests/mm/Makefile
@@ -112,7 +112,9 @@ endif
ifneq (,$(filter $(ARCH),arm64 ia64 mips64 parisc64 powerpc riscv64 s390x sparc64 x86_64))
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 03ac4f2e1cce..7caa624a2e5a 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"
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] selftest/mm: Fix typo in virtual_address_range
2024-09-13 2:26 [PATCH 1/2] selftest/mm: Fix typo in virtual_address_range Chunyan Zhang
2024-09-13 2:26 ` [PATCH 2/2] selftests/mm: skip virtual_address_range tests on riscv Chunyan Zhang
@ 2024-09-13 3:16 ` Charlie Jenkins
2024-12-11 22:32 ` patchwork-bot+linux-riscv
2 siblings, 0 replies; 6+ messages in thread
From: Charlie Jenkins @ 2024-09-13 3:16 UTC (permalink / raw)
To: Chunyan Zhang
Cc: Andrew Morton, Shuah Khan, Paul Walmsley, Palmer Dabbelt,
Alexandre Ghiti, linux-mm, linux-kselftest, linux-riscv,
linux-kernel, Chunyan Zhang
On Fri, Sep 13, 2024 at 10:26:34AM +0800, Chunyan Zhang wrote:
> The function name should be *hint* address, so correct it.
>
> Signed-off-by: Chunyan Zhang <zhangchunyan@iscas.ac.cn>
Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
> ---
> tools/testing/selftests/mm/virtual_address_range.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/mm/virtual_address_range.c b/tools/testing/selftests/mm/virtual_address_range.c
> index 4e4c1e311247..2a2b69e91950 100644
> --- a/tools/testing/selftests/mm/virtual_address_range.c
> +++ b/tools/testing/selftests/mm/virtual_address_range.c
> @@ -64,7 +64,7 @@
> #define NR_CHUNKS_HIGH NR_CHUNKS_384TB
> #endif
>
> -static char *hind_addr(void)
> +static char *hint_addr(void)
> {
> int bits = HIGH_ADDR_SHIFT + rand() % (63 - HIGH_ADDR_SHIFT);
>
> @@ -185,7 +185,7 @@ int main(int argc, char *argv[])
> }
>
> for (i = 0; i < NR_CHUNKS_HIGH; i++) {
> - hint = hind_addr();
> + hint = hint_addr();
> hptr[i] = mmap(hint, MAP_CHUNK_SIZE, PROT_READ | PROT_WRITE,
> MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] selftests/mm: skip virtual_address_range tests on riscv
2024-09-13 2:26 ` [PATCH 2/2] selftests/mm: skip virtual_address_range tests on riscv Chunyan Zhang
@ 2024-09-13 3:22 ` Charlie Jenkins
2024-09-13 3:41 ` Chunyan Zhang
0 siblings, 1 reply; 6+ messages in thread
From: Charlie Jenkins @ 2024-09-13 3:22 UTC (permalink / raw)
To: Chunyan Zhang
Cc: Andrew Morton, Shuah Khan, Paul Walmsley, Palmer Dabbelt,
Alexandre Ghiti, linux-mm, linux-kselftest, linux-riscv,
linux-kernel, Chunyan Zhang
On Fri, Sep 13, 2024 at 10:26:35AM +0800, Chunyan Zhang 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.
>
> Signed-off-by: Chunyan Zhang <zhangchunyan@iscas.ac.cn>
Which tree does this apply onto? It is failing to apply on -rc7. Also,
since this is the second version of this patch it is good practice to
put v2 in the subject like [PATCH v2 2/2]. Anyways, the content of this
patch looks good!
Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
> ---
> 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 84573ddfcfa2..912778347213 100644
> --- a/tools/testing/selftests/mm/Makefile
> +++ b/tools/testing/selftests/mm/Makefile
> @@ -112,7 +112,9 @@ endif
>
> ifneq (,$(filter $(ARCH),arm64 ia64 mips64 parisc64 powerpc riscv64 s390x sparc64 x86_64))
> 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 03ac4f2e1cce..7caa624a2e5a 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"
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] selftests/mm: skip virtual_address_range tests on riscv
2024-09-13 3:22 ` Charlie Jenkins
@ 2024-09-13 3:41 ` Chunyan Zhang
0 siblings, 0 replies; 6+ messages in thread
From: Chunyan Zhang @ 2024-09-13 3:41 UTC (permalink / raw)
To: Charlie Jenkins
Cc: Chunyan Zhang, Andrew Morton, Shuah Khan, Paul Walmsley,
Palmer Dabbelt, Alexandre Ghiti, linux-mm, linux-kselftest,
linux-riscv, linux-kernel
Hi Charlie,
On Fri, 13 Sept 2024 at 11:22, Charlie Jenkins <charlie@rivosinc.com> wrote:
>
> On Fri, Sep 13, 2024 at 10:26:35AM +0800, Chunyan Zhang 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.
> >
> > Signed-off-by: Chunyan Zhang <zhangchunyan@iscas.ac.cn>
>
> Which tree does this apply onto? It is failing to apply on -rc7. Also,
Oh, it applies to -rc1.
> since this is the second version of this patch it is good practice to
> put v2 in the subject like [PATCH v2 2/2]. Anyways, the content of this
> patch looks good!
>
> Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
Thanks,
Chunyan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] selftest/mm: Fix typo in virtual_address_range
2024-09-13 2:26 [PATCH 1/2] selftest/mm: Fix typo in virtual_address_range Chunyan Zhang
2024-09-13 2:26 ` [PATCH 2/2] selftests/mm: skip virtual_address_range tests on riscv Chunyan Zhang
2024-09-13 3:16 ` [PATCH 1/2] selftest/mm: Fix typo in virtual_address_range Charlie Jenkins
@ 2024-12-11 22:32 ` patchwork-bot+linux-riscv
2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+linux-riscv @ 2024-12-11 22:32 UTC (permalink / raw)
To: Chunyan Zhang
Cc: linux-riscv, akpm, shuah, paul.walmsley, palmer, alex, charlie,
linux-mm, linux-kselftest, linux-kernel, zhang.lyra
Hello:
This series was applied to riscv/linux.git (fixes)
by Andrew Morton <akpm@linux-foundation.org>:
On Fri, 13 Sep 2024 10:26:34 +0800 you wrote:
> The function name should be *hint* address, so correct it.
>
> Signed-off-by: Chunyan Zhang <zhangchunyan@iscas.ac.cn>
> ---
> tools/testing/selftests/mm/virtual_address_range.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Here is the summary with links:
- [1/2] selftest/mm: Fix typo in virtual_address_range
https://git.kernel.org/riscv/c/e847f8cd96ae
- [2/2] selftests/mm: skip virtual_address_range tests on riscv
(no matching commit)
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-12-11 22:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-13 2:26 [PATCH 1/2] selftest/mm: Fix typo in virtual_address_range Chunyan Zhang
2024-09-13 2:26 ` [PATCH 2/2] selftests/mm: skip virtual_address_range tests on riscv Chunyan Zhang
2024-09-13 3:22 ` Charlie Jenkins
2024-09-13 3:41 ` Chunyan Zhang
2024-09-13 3:16 ` [PATCH 1/2] selftest/mm: Fix typo in virtual_address_range Charlie Jenkins
2024-12-11 22:32 ` patchwork-bot+linux-riscv
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).