Skip to content

[bpf-ci-bot] tc_edt test flaky on x86_64 ASAN: rate error tolerance too tight under instrumentation #503

Description

@kernel-patches-review-bot

Summary

The tc_edt selftest fails intermittently on x86_64 test_progs ASAN runs because its 2% rate error tolerance is insufficient when AddressSanitizer instrumentation is active. ASAN adds overhead to every memory access, introducing timing jitter that pushes the measured throughput error above the 2% threshold.

Failure Details

  • Test / Component: tc_edt (test_progs ASAN on x86_64)
  • Frequency: occasional — observed in "Simplify min()/max()" PR (run 30778181064), independent of the patch content
  • Failure mode: flaky assertion failure
  • Affected architectures: x86_64 (ASAN only); already denylisted on s390x for the same timing sensitivity
  • CI runs observed:

Root Cause Analysis

The test (tools/testing/selftests/bpf/prog_tests/test_tc_edt.c) works by:

  1. Setting up two network namespaces connected by a veth pair
  2. Attaching a BPF TC program that shapes traffic to 5 Mbps (via EDT timestamps)
  3. Sending 1 MB of data and measuring elapsed time
  4. Computing rate_error = |measured_rate - 5.0| / 5.0 * 100
  5. Asserting rate_error <= 2.0 (line 126)

Under ASAN, malloc/free/memcpy instrumentation adds ~2-5x overhead to userspace operations including the send()/recv() loop in send_recv_data(). While the BPF shaping runs in kernel space (unaffected by ASAN), the userspace timestamp measurements (get_time_ns() at lines 116/118) include ASAN-slowed syscall entry/exit paths. This can push the measured rate slightly away from the true shaped rate, causing marginal failures like the observed "actual 2 > expected 2".

The test is already denylisted on s390x (DENYLIST.s390x) for the same fundamental reason — timing-sensitive rate measurements are unreliable in environments with non-trivial overhead.

Proposed Fix

Add tc_edt to DENYLIST.asan in the CI configuration. This is the same approach used for s390x. The test remains fully exercised in non-ASAN x86_64/aarch64 runs where timing is reliable.

See attached patch: 0001-selftests-bpf-Add-tc_edt-to-CI-ASAN-DENYLIST.patch

Impact

Without the fix, tc_edt occasionally causes false CI failures on ASAN runs, adding noise and forcing re-runs of PRs that don't touch networking code.

References

  • tools/testing/selftests/bpf/prog_tests/test_tc_edt.c — test implementation
  • github/kernel-patches/vmtest/ci/vmtest/configs/DENYLIST.s390x — already denylists tc_edt
  • github/kernel-patches/vmtest/ci/vmtest/configs/DENYLIST.asan — target for this fix
  • Commit b0f82e7ab6fb ("selftests/bpf: integrate test_tc_edt into test_progs") — test introduction

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions