Skip to content

selftests/bpf: perf_link: avoid failures in concurrent mode#11296

Open
kernel-patches-daemon-bpf[bot] wants to merge 1 commit intobpf-next_basefrom
series/1061795=>bpf-next
Open

selftests/bpf: perf_link: avoid failures in concurrent mode#11296
kernel-patches-daemon-bpf[bot] wants to merge 1 commit intobpf-next_basefrom
series/1061795=>bpf-next

Conversation

@kernel-patches-daemon-bpf
Copy link

Pull request for series with
subject: selftests/bpf: perf_link: avoid failures in concurrent mode
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1061795

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 4faa189
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1061795
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 748f9c6
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1061795
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 6dd780f
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1061795
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 6dd780f
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1061795
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 099bded
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1061795
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: bd2e02e
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1061795
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: bd2e02e
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1061795
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 0c55d48
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1061795
version: 1

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>
@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: e95e85b
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1061795
version: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant