From: Yonghong Song <yhs@fb.com>
To: "sunyucong@gmail.com" <sunyucong@gmail.com>
Cc: Yucong Sun <fallentree@fb.com>,
Andrii Nakryiko <andrii@kernel.org>, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH v3 bpf-next] selftests/bpf: Add parallelism to test_progs
Date: Sun, 12 Sep 2021 19:43:16 -0700 [thread overview]
Message-ID: <97fb8a21-70b5-39e6-6d6a-63cce9c17911@fb.com> (raw)
In-Reply-To: <CAJygYd3NX3qi7sOHiQOmbiJju8zMy3ip0bmreOmRPtgp=S3YtA@mail.gmail.com>
On 9/10/21 11:53 AM, sunyucong@gmail.com wrote:
> On Fri, Sep 10, 2021 at 2:28 PM Yonghong Song <yhs@fb.com> wrote:
>>
>>
>>
>> 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
>
> Sorry, It seems I forgot to test without "-n" param, here is a
> trivial patch that will make it work.
>
> diff --git a/tools/testing/selftests/bpf/test_progs.c
> b/tools/testing/selftests/bpf/test_progs.c
> index 74c6ea45502d..dd7bb2bec4d4 100644
> --- a/tools/testing/selftests/bpf/test_progs.c
> +++ b/tools/testing/selftests/bpf/test_progs.c
> @@ -780,7 +780,7 @@ void crash_handler(int signum)
> backtrace_symbols_fd(bt, sz, STDERR_FILENO);
> }
>
> -int current_test_idx = -1;
> +int current_test_idx = 0;
> pthread_mutex_t current_test_lock;
>
> struct test_result {
Indeed. With this change the './test_progs -j' finished
although I saw some test failures which is also mentioned
in the patch itself.
>
>
> Cheers.
>
prev parent reply other threads:[~2021-09-13 2:43 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
2021-09-10 18:53 ` sunyucong
2021-09-13 2:43 ` Yonghong Song [this message]
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=97fb8a21-70b5-39e6-6d6a-63cce9c17911@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