Skip to content

selftests/bpf: Run the enable_stats program with BPF_PROG_TEST_RUN - #14432

Closed
kernel-patches-daemon-bpf[bot] wants to merge 2 commits into
bpf-next_basefrom
series/1188562=>bpf-next
Closed

kernel-patches-daemon-bpf[bot] wants to merge 2 commits into
bpf-next_basefrom
series/1188562=>bpf-next

Conversation

@kernel-patches-daemon-bpf

Copy link
Copy Markdown

Pull request for series with
subject: selftests/bpf: Run the enable_stats program with BPF_PROG_TEST_RUN
version: 3
url: https://patchwork.kernel.org/series/1188562/

@kernel-patches-daemon-bpf

Copy link
Copy Markdown
Author

Upstream branch: 44b6b1d
series: https://patchwork.kernel.org/series/1188562/
version: 3

@kernel-patches-daemon-bpf

Copy link
Copy Markdown
Author

Upstream branch: 4f84263
series: https://patchwork.kernel.org/series/1188562/
version: 3

@kernel-patches-daemon-bpf

Copy link
Copy Markdown
Author

Upstream branch: 868e56d
series: https://patchwork.kernel.org/series/1188562/
version: 3

@kernel-patches-daemon-bpf

Copy link
Copy Markdown
Author

Upstream branch: 4f84263
series: https://patchwork.kernel.org/series/1188562/
version: 3

@kernel-patches-daemon-bpf

Copy link
Copy Markdown
Author

Upstream branch: 25bb03f
series: https://patchwork.kernel.org/series/1188562/
version: 3

@kernel-patches-daemon-bpf

Copy link
Copy Markdown
Author

Upstream branch: 0867b7b
series: https://patchwork.kernel.org/series/1188562/
version: 3

@kernel-patches-daemon-bpf

Copy link
Copy Markdown
Author

Upstream branch: 1907a7d
series: https://patchwork.kernel.org/series/1188562/
version: 3

@kernel-patches-daemon-bpf

Copy link
Copy Markdown
Author

Upstream branch: f25f631
series: https://patchwork.kernel.org/series/1188562/
version: 3

@kernel-patches-daemon-bpf

Copy link
Copy Markdown
Author

Upstream branch: b713263
series: https://patchwork.kernel.org/series/1188562/
version: 3

@kernel-patches-daemon-bpf

Copy link
Copy Markdown
Author

Upstream branch: d4bccf4
series: https://patchwork.kernel.org/series/1188562/
version: 3

enable_stats attaches its program to sys_enter, so every syscall of the
system runs it. Once the program is detached, the test compares its
run_cnt to the number of runs the program counted itself.

Detaching doesn't wait for the runs already started on other CPUs, and
each of them increments count before run_cnt. With other tests making
syscalls in parallel, the test reads run_cnt one run behind count now
and then:

  test_enable_stats:FAIL:check_run_cnt_valid invalid run_cnt stats

Run the program 1000 times with BPF_PROG_TEST_RUN instead of attaching
it, so that nothing else runs it and both counts are final when the test
reads them.

enable_stats run 100 times with 32 processes calling dd with bs=1 in
the background, on a bpf-next kernel with KASAN enabled, x86_64 VM with
32 vCPUs, before and after this patch:

            before                                after
  outcome   3 of 100 failed (check_run_cnt_valid)   0 of 100 failed

Fixes: 31a9f7f ("bpf: Add selftest for BPF_ENABLE_STATS")
Signed-off-by: Qiliang Yuan <odys.yuan@gmail.com>
@kernel-patches-daemon-bpf

Copy link
Copy Markdown
Author

At least one diff in series https://patchwork.kernel.org/series/1188562/ expired. Closing PR.

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.

0 participants