Skip to content

perf(coro): streamline demand-free syscall handoffs - #166

Merged
cpunion merged 2 commits into
llvm-corofrom
coro/io-perf-rootcause-20260815
Aug 14, 2026
Merged

perf(coro): streamline demand-free syscall handoffs#166
cpunion merged 2 commits into
llvm-corofrom
coro/io-perf-rootcause-20260815

Conversation

@cpunion

@cpunion cpunion commented Aug 14, 2026

Copy link
Copy Markdown
Owner

This reduces the remaining scheduler-side cost of compiler-certified native syscalls without weakening blocking compensation.

What changes:

  • Arm deferred syscall compensation without eagerly allocating a replacement directory slot. Only a durable request that wins Armed -> Starting materializes the slot and physical owner.
  • Consume the compiler-hidden task capability to freeze the current driver route and avoid repeated complete source-catalog/owner-local audits during detach, quota release, and reentry.
  • Keep the original full validation path for TLS/reentry, retained, and other non-compiler callers.
  • Add race/unit/source-architecture gates for the slotless Armed/Starting protocol and compiler-task detach path.

Measured on Darwin arm64, Go 1.26.5, LLVM 22.1.8, full LTO, GOMAXPROCS=1, 15 rotated process runs:

workload scalar parent candidate delta candidate / Go
standard file, 5,000 ops 42.343 ms 38.376 ms -9.37% 4.94x
direct syscall file, 5,000 ops 18.485 ms 15.826 ms -14.39% 2.07x
loopback TCP, 500 ops 19.980 ms 19.343 ms -3.19% (overlapping ranges) 2.04x

Size changes: stripped binary +1,520 bytes (+0.022%); Mach-O __text +3,700 bytes (+0.118%).

Validated locally:

  • full runtime module
  • coroutine architecture-debt and native target-plan gates
  • same-M scheduler progress, locked compensation, and request-driven direct-channel replacement E2Es
  • real standard file, direct syscall, sole-M blocking pipe + timer, and loopback TCP executions

The next performance target remains synchronous child-frame allocation/publication/destroy through syscall, internal/poll, os.File, and io; this PR deliberately does not mix that lifecycle work into the native handoff protocol.

@cpunion
cpunion merged commit db6a6eb into llvm-coro Aug 14, 2026
26 of 27 checks passed
@cpunion
cpunion deleted the coro/io-perf-rootcause-20260815 branch August 14, 2026 20:42
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