[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKgT0Uf-ax6F12Uxex_vTiKB44QnZH=DA-jbtYj6_LsweAH-Ow@mail.gmail.com>
Date: Mon, 26 Aug 2024 09:30:41 -0700
From: Alexander Duyck <alexander.duyck@...il.com>
To: Yunsheng Lin <linyunsheng@...wei.com>
Cc: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>, Shuah Khan <shuah@...nel.org>, linux-mm@...ck.org,
linux-kselftest@...r.kernel.org
Subject: Re: [PATCH net-next v15 01/13] mm: page_frag: add a test module for page_frag
On Mon, Aug 26, 2024 at 5:46 AM Yunsheng Lin <linyunsheng@...wei.com> wrote:
>
> The testing is done by ensuring that the fragment allocated
> from a frag_frag_cache instance is pushed into a ptr_ring
> instance in a kthread binded to a specified cpu, and a kthread
> binded to a specified cpu will pop the fragment from the
> ptr_ring and free the fragment.
>
> CC: Alexander Duyck <alexander.duyck@...il.com>
> Signed-off-by: Yunsheng Lin <linyunsheng@...wei.com>
> ---
> tools/testing/selftests/mm/Makefile | 2 +
> tools/testing/selftests/mm/page_frag/Makefile | 18 ++
> .../selftests/mm/page_frag/page_frag_test.c | 170 ++++++++++++++++++
> tools/testing/selftests/mm/run_vmtests.sh | 9 +-
> 4 files changed, 198 insertions(+), 1 deletion(-)
> create mode 100644 tools/testing/selftests/mm/page_frag/Makefile
> create mode 100644 tools/testing/selftests/mm/page_frag/page_frag_test.c
>
...
I am good with everything up to this point.
> diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh
> index 36045edb10de..9a788d5f3f28 100755
> --- a/tools/testing/selftests/mm/run_vmtests.sh
> +++ b/tools/testing/selftests/mm/run_vmtests.sh
> @@ -75,6 +75,8 @@ separated by spaces:
> read-only VMAs
> - mdwe
> test prctl(PR_SET_MDWE, ...)
> +- page_frag
> + test handling of page fragment allocation and freeing
>
> example: ./run_vmtests.sh -t "hmm mmap ksm"
> EOF
> @@ -231,7 +233,8 @@ run_test() {
> ("$@" 2>&1) | tap_prefix
> local ret=${PIPESTATUS[0]}
> count_total=$(( count_total + 1 ))
> - if [ $ret -eq 0 ]; then
> + # page_frag_test.ko returns 11(EAGAIN) when insmod'ing to avoid rmmod
> + if [ $ret -eq 0 ] | [ $ret -eq 11 -a ${CATEGORY} == "page_frag" ]; then
> count_pass=$(( count_pass + 1 ))
> echo "[PASS]" | tap_prefix
> echo "ok ${count_total} ${test}" | tap_output
> @@ -456,6 +459,10 @@ CATEGORY="mkdirty" run_test ./mkdirty
>
> CATEGORY="mdwe" run_test ./mdwe_test
>
> +CATEGORY="page_frag" run_test insmod ./page_frag/page_frag_test.ko
> +
> +CATEGORY="page_frag" run_test insmod ./page_frag/page_frag_test.ko test_alloc_len=12 test_align=1
> +
> echo "SUMMARY: PASS=${count_pass} SKIP=${count_skip} FAIL=${count_fail}" | tap_prefix
> echo "1..${count_total}" | tap_output
>
I don't know if this piece is needed. My thought would be rather than
mess with the run_vmtest.sh directly which is more of a pass/fail test
it might be better to handle this more like test_vmalloc.sh and just
put together your own performance test that you can run to collect the
data, and then if you want to be a part of this test you could call
that script from here.
Powered by blists - more mailing lists