Skip to content

Move rt_regs from stack to record scratch#1286

Open
gnurizen wants to merge 1 commit intoopen-telemetry:mainfrom
parca-dev:shrink-stack
Open

Move rt_regs from stack to record scratch#1286
gnurizen wants to merge 1 commit intoopen-telemetry:mainfrom
parca-dev:shrink-stack

Conversation

@gnurizen
Copy link
Copy Markdown
Contributor

@gnurizen gnurizen commented Mar 25, 2026

This is another prep the patient PR for a hybrid python native unwinder. Combining the two unwinders exhausted the bpf stack and this fixes it.

@gnurizen gnurizen changed the title shrink stack Move rt_regs from stack to record scratch Mar 25, 2026
@gnurizen
Copy link
Copy Markdown
Contributor Author

I was hoping for this PR to just be one commit relative to PR 1280 but GH requires base branch to be in this repo.

@gnurizen gnurizen marked this pull request as ready for review March 25, 2026 18:45
@gnurizen gnurizen requested review from a team as code owners March 25, 2026 18:45
@gnurizen gnurizen force-pushed the shrink-stack branch 2 times, most recently from c8ee363 to 0cf56fc Compare March 26, 2026 16:16
@fabled
Copy link
Copy Markdown
Contributor

fabled commented Apr 8, 2026

I think the commit to move rt_regs to scratch looks good. Could this be done before the other PR? That is, can you rebase this directly on top of main?

@gnurizen
Copy link
Copy Markdown
Contributor Author

gnurizen commented Apr 8, 2026

Yeah I can rebase this to main and make it standalone and pull this out of the commit set in #1288

@gnurizen
Copy link
Copy Markdown
Contributor Author

gnurizen commented Apr 8, 2026

Rebased to main and RFAL.

On arm64, rt_regs[34] consumes 272 bytes of the 512-byte BPF stack.
When unwind_one_frame is inlined into interpreter unwinders, this
exceeds the stack limit. Move rt_regs into the PerCPURecord scratch
union which is already 1024+ bytes and unused during signal frame
handling.
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.

2 participants