Commit f6b1f63
selftests/bpf: perf_link: avoid failures in concurrent mode
perf_link creates a system-wide perf event pinned to CPU 0 (pid=-1, cpu=0)
and also pins the test thread to CPU 0. Under concurrent selftests this
can lead to cross-test interference and CPU 0 contention, making the test
flaky.
Create a per-task perf event instead (pid=0, cpu=-1) and drop CPU pinning
from burn_cpu(). Use barrier() to prevent the burn loop from being
optimized away. Drop the serial_ prefix so the test can run in parallel.
Also remove the stale TODO comment.
Tested:
./test_progs -t perf_link -vv
./test_progs -j$(nproc) -t perf_link -vv
for i in $(seq 1 50); do ./test_progs -j$(nproc) -t perf_link; done
Signed-off-by: Sun Jian <sun.jian.kdev@gmail.com>
Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>1 parent 59120bd commit f6b1f63
1 file changed
+5
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 4 | + | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 14 | + | |
24 | 15 | | |
25 | 16 | | |
26 | 17 | | |
27 | | - | |
| 18 | + | |
28 | 19 | | |
29 | 20 | | |
30 | | - | |
31 | | - | |
| 21 | + | |
32 | 22 | | |
33 | 23 | | |
34 | 24 | | |
| |||
45 | 35 | | |
46 | 36 | | |
47 | 37 | | |
48 | | - | |
| 38 | + | |
49 | 39 | | |
50 | 40 | | |
51 | 41 | | |
| |||
0 commit comments