runtime: fix multicore RISC-V GC synchronization - #5682
jakebailey wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The renamed assembly symbol makes RISC-V stack-size reports omit the context-switch frame.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR separates RISC-V scheduler and GC signals to prevent multicore deadlocks.
Changes:
- Adds per-hart GC and scheduler signals.
- Makes RISC-V stack switching interrupt-safe.
- Adds a multicore GC regression test.
File summaries
| File | Description |
|---|---|
testdata/gcmulticore.txt |
Defines expected test output. |
testdata/gcmulticore.go |
Exercises repeated multicore GC cycles. |
src/runtime/runtime_tinygoriscv_qemu.go |
Separates interrupt signals and improves diagnostics. |
src/runtime/runtime_rp2.go |
Adds the shared stack-state helper. |
src/runtime/gc_stack_cores.go |
Uses target-specific stack-state detection. |
src/internal/task/task_stack_tinygoriscv.S |
Protects RISC-V stack switches from interrupts. |
src/internal/task/task_stack_tinygoriscv.go |
Updates the RISC-V stack-switch interface. |
main_test.go |
Registers and configures the regression test. |
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
07e02b3 to
a79bf14
Compare
|
Thank you @jakebailey for this fix. The following items are an edited version of an automated review.
The |
Separate scheduler wakeups, GC pause requests, and GC phase signals so software interrupts cannot consume requests for another subsystem. Make RISC-V task stack switches atomic with respect to interrupts and derive GC stack selection from saved system stack state. This prevents the collector from scanning a nil or incorrect stack during a switch. Include mtval in exception reports to identify invalid access addresses. Fixes 5679
a79bf14 to
7437f08
Compare
|
Thank you @jakebailey for the update. All 5 items from the last review are corrected. The following items are an edited version of an automated review.
I assembled |
Fixes #5679
See commit descriptions; the gist is that scheduler waking and GC were sharing the same signals, causing confusion, so split them up. Other platforms do not seem to have this problem.