BPF List
 help / color / mirror / Atom feed
From: Yonghong Song <yhs@fb.com>
To: Yucong Sun <fallentree@fb.com>, <andrii@kernel.org>
Cc: <bpf@vger.kernel.org>, Yucong Sun <sunyucong@gmail.com>
Subject: Re: [PATCH v3 bpf-next] selftests/bpf: Add parallelism to test_progs
Date: Fri, 10 Sep 2021 11:28:51 -0700	[thread overview]
Message-ID: <40733168-d1b1-4d9e-63a5-e767bc9dc1ad@fb.com> (raw)
In-Reply-To: <20210909193544.1829238-1-fallentree@fb.com>



On 9/9/21 12:35 PM, Yucong Sun wrote:
> From: Yucong Sun <sunyucong@gmail.com>
> 
> This patch adds "-j" mode to test_progs, executing tests in multiple process.
> "-j" mode is optional, and works with all existing test selection mechanism, as
> well as "-v", "-l" etc.
> 
> In "-j" mode, main process use UDS/DGRAM to communicate to each forked worker,
> commanding it to run tests and collect logs. After all tests are finished, a
> summary is printed. main process use multiple competing threads to dispatch
> work to worker, trying to keep them all busy.
> 
> Example output:
> 
>    > ./test_progs -n 15-20 -j
>    [    8.584709] bpf_testmod: loading out-of-tree module taints kernel.
>    Launching 2 workers.
>    [0]: Running test 15.
>    [1]: Running test 16.
>    [1]: Running test 17.
>    [1]: Running test 18.
>    [1]: Running test 19.
>    [1]: Running test 20.
>    [1]: worker exit.
>    [0]: worker exit.
>    #15 btf_dump:OK
>    #16 btf_endian:OK
>    #17 btf_map_in_map:OK
>    #18 btf_module:OK
>    #19 btf_skc_cls_ingress:OK
>    #20 btf_split:OK
>    Summary: 6/20 PASSED, 0 SKIPPED, 0 FAILED

I tried the patch with latest bpf-next and
 
https://lore.kernel.org/bpf/20210909215658.hgqkvxvtjrvdnrve@revolver/T/#u
to avoid kernel warning.

My commandline is ./test_progs -j
my env is a 4 cpu qemu.
It seems the test is stuck and cannot finish:
...
Still waiting for thread 0 (test 0). 
 

Still waiting for thread 0 (test 0). 
 

Still waiting for thread 0 (test 0). 
 

Still waiting for thread 0 (test 0). 
 

Still waiting for thread 0 (test 0). 
 

 
 

[1]+  Stopped                 ./test_progs -j
root@arch-fb-vm1:~/net-next/bpf-next/tools/testing/selftests/bpf ps
   PID TTY          TIME CMD
   231 ttyS0    00:00:00 bash
   254 ttyS0    00:00:00 test_progs
   256 ttyS0    00:00:00 test_progs <defunct>
   257 ttyS0    00:00:12 new_name <defunct>
   258 ttyS0    00:01:03 test_progs <defunct>
   259 ttyS0    00:00:02 test_progs <defunct>
  1310 ttyS0    00:00:00 ps
root@arch-fb-vm1:~/net-next/bpf-next/tools/testing/selftests/bpf fg
./test_progs -j
Still waiting for thread 0 (test 0).
Still waiting for thread 0 (test 0).
Still waiting for thread 0 (test 0).
Still waiting for thread 0 (test 0).
Still waiting for thread 0 (test 0).
Still waiting for thread 0 (test 0).
...

I didn't further debug what is the issue.

> 
> Know issue:
> 
> Some tests fail when running concurrently, later patch will either
> fix the test or pin them to worker 0.
> 
> Signed-off-by: Yucong Sun <sunyucong@gmail.com>
> 
> V3 -> V2: fix missing outputs in commit messages.
> V2 -> V1: switch to UDS client/server model.
> ---
>   tools/testing/selftests/bpf/test_progs.c | 456 ++++++++++++++++++++++-
>   tools/testing/selftests/bpf/test_progs.h |  36 +-
>   2 files changed, 478 insertions(+), 14 deletions(-)
> 
[...]

  reply	other threads:[~2021-09-10 18:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09 19:35 [PATCH v3 bpf-next] selftests/bpf: Add parallelism to test_progs Yucong Sun
2021-09-10 18:28 ` Yonghong Song [this message]
2021-09-10 18:53   ` sunyucong
2021-09-13  2:43     ` Yonghong Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40733168-d1b1-4d9e-63a5-e767bc9dc1ad@fb.com \
    --to=yhs@fb.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=fallentree@fb.com \
    --cc=sunyucong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox