]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Fix test_progs send_signal flakiness with nmi mode
authorYonghong Song <yhs@fb.com>
Thu, 16 Jan 2020 17:40:04 +0000 (09:40 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 16 Jan 2020 21:28:57 +0000 (13:28 -0800)
commitae07fc24234affae93b457d69625fa1103188532
tree959a081af0c6533335d84f7615b1911fd1911f09
parent548d43f350f080c1c4ed7934fe01d9858719bb47
selftests/bpf: Fix test_progs send_signal flakiness with nmi mode

Alexei observed that test_progs send_signal may fail if run
with command line "./test_progs" and the tests will pass
if just run "./test_progs -n 40".

I observed similar issue with nmi subtest failure
and added a delay 100 us in Commit f96065e4026f
("tools/bpf: Add self tests for bpf_send_signal_thread()")
and the problem is gone for me. But the issue still exists
in Alexei's testing environment.

The current code uses sample_freq = 50 (50 events/second), which
may not be enough. But if the sample_freq value is larger than
sysctl kernel/perf_event_max_sample_rate, the perf_event_open
syscall will fail.

This patch changed nmi perf testing to use sample_period = 1,
which means trying to sampling every event. This seems fixing
the issue.

Fixes: f96065e4026f ("tools/bpf: Add self tests for bpf_send_signal_thread()")
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200116174004.1522812-1-yhs@fb.com
tools/testing/selftests/bpf/prog_tests/send_signal.c