Skip to content

feat(memtrack): pause producers under ring pressure - #543

Draft
not-matthias wants to merge 4 commits into
cod-3222-add-ebpf-based-dwarffp-unwindingfrom
feat/memtrack-pause-worker
Draft

not-matthias wants to merge 4 commits into
cod-3222-add-ebpf-based-dwarffp-unwindingfrom
feat/memtrack-pause-worker

Conversation

@not-matthias

Copy link
Copy Markdown
Member

Adds opt-in, best-effort backpressure for memtrack's BPF ring buffers.

When a ring crosses its watermark, BPF latches the episode and stops the winning tracked producer. A userspace coordinator then stops the owned process tree using pidfds, drains the event, stack, mapping, and attach pipelines, clears the latch, and resumes the tree. Finite timeouts terminate the tracked tree and fail the capture; 0 remains the default and preserves drop detection, while inf waits until recovery. Detected ring loss still fails the capture.

The change also:

  • lowers ring polling latency from 10 ms to 1 ms
  • keeps attach/startup resume ownership coordinated with pressure pauses
  • propagates the timeout through the runner's experimental memory-mode flag
  • avoids x86 per-CPU private BPF stack corruption during nested uprobes by keeping hash scratch in the unpublished ring record and reducing BPF stack use

This PR is stacked on #522.

Verification

  • cargo fmt --all -- --check
  • cargo clippy --release -p memtrack -p codspeed-runner -- -D warnings
  • Runtime tests are deferred to CI.

@codspeed

codspeed Bot commented Sep 22, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 33 untouched benchmarks
⏩ 4 skipped benchmarks1


Comparing feat/memtrack-pause-worker (15e7943) with cod-3222-add-ebpf-based-dwarffp-unwinding (2152fe2)

Open in CodSpeed

Footnotes

  1. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Remove redundant implementation narration and clarify the current overflow and teardown behavior without changing runtime semantics.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant