diff mbox series

[bpf-next,v6,03/14] selftests/bpf: disable perf rate limiting when running tests.

Message ID 20211006185619.364369-4-fallentree@fb.com (mailing list archive)
State Changes Requested
Delegated to: BPF
Headers show
Series selftests/bpf: Add parallelism to test_progs | expand

Checks

Context Check Description
netdev/cover_letter success Series has a cover letter
netdev/fixes_present success Fixes tag not required for -next series
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for bpf-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 10 maintainers not CCed: linux-kselftest@vger.kernel.org netdev@vger.kernel.org shuah@kernel.org kafai@fb.com daniel@iogearbox.net yhs@fb.com john.fastabend@gmail.com songliubraving@fb.com kpsingh@kernel.org ast@kernel.org
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success No Fixes tag
netdev/checkpatch warning WARNING: From:/Signed-off-by: email address mismatch: 'From: Yucong Sun <fallentree@fb.com>' != 'Signed-off-by: Yucong Sun <sunyucong@gmail.com>'
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success No static functions without inline keyword in header files
bpf/vmtest-bpf-next success VM_Test
bpf/vmtest-bpf-next-PR success PR summary

Commit Message

Yucong Sun Oct. 6, 2021, 6:56 p.m. UTC
When running tests concurrently, perf rate limiting will often cause
some events to be skipped and make some tests flaky, disabling it making
running tests more robust.

Signed-off-by: Yucong Sun <sunyucong@gmail.com>
---
 tools/testing/selftests/bpf/test_progs.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Andrii Nakryiko Oct. 8, 2021, 10:26 p.m. UTC | #1
On Wed, Oct 6, 2021 at 11:56 AM Yucong Sun <fallentree@fb.com> wrote:
>
> When running tests concurrently, perf rate limiting will often cause
> some events to be skipped and make some tests flaky, disabling it making
> running tests more robust.
>
> Signed-off-by: Yucong Sun <sunyucong@gmail.com>
> ---
>  tools/testing/selftests/bpf/test_progs.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c
> index 4e2028189471..2ac922f8aa2c 100644
> --- a/tools/testing/selftests/bpf/test_progs.c
> +++ b/tools/testing/selftests/bpf/test_progs.c
> @@ -1376,6 +1376,8 @@ int main(int argc, char **argv)
>                 }
>         }
>
> +       system("echo 0 > /proc/sys/kernel/perf_cpu_time_max_percent");

I don't think we want to do this outside of QEMU, changing the global
state of the real system. I think this might have also been relevant
to me waiting for perf_branches test for about 20 seconds or so. I've
dropped this patch for now.


> +
>         /* ignore workers if we are just listing */
>         if (env.get_test_cnt || env.list_test_names)
>                 env.workers = 0;
> --
> 2.30.2
>
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c
index 4e2028189471..2ac922f8aa2c 100644
--- a/tools/testing/selftests/bpf/test_progs.c
+++ b/tools/testing/selftests/bpf/test_progs.c
@@ -1376,6 +1376,8 @@  int main(int argc, char **argv)
 		}
 	}
 
+	system("echo 0 > /proc/sys/kernel/perf_cpu_time_max_percent");
+
 	/* ignore workers if we are just listing */
 	if (env.get_test_cnt || env.list_test_names)
 		env.workers = 0;