Skip to content

coro: demand-gate native syscall compensation - #161

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

coro: demand-gate native syscall compensation#161
cpunion merged 2 commits into
llvm-corofrom
coro/io-perf-root-20260814

Conversation

@cpunion

@cpunion cpunion commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Moves compiler-certified llgo.syscall calls off the generic worker transaction and onto one same-M entersyscall/exitsyscall boundary, while preserving worker/locked-M behavior for ordinary C and cgo calls.

Highlights:

  • structurally omit worker park/resume CFG and worker state from certified native syscall lowering
  • classify replacement demand at the detached scheduler boundary with one common external-source count plus the orthogonal TaskControl endpoint count
  • asynchronously request/cancel cached clean M owners with exact dispatch/claim/return races
  • fail closed on ambiguous managed-quota release and correctly follow replacement retirement successors by generation baton
  • add direct-syscall and genuinely blocking pipe fixtures, design gates, and measured performance checkpoint

Validation:

  • full runtime go test -p=1 -timeout=180s ./...
  • focused compiler syscall/worker tests
  • internal/build complete TestCoro* suite
  • native corofleet C harness at -count=20
  • replacement-owner retirement E2E at -count=10
  • fresh LLVM 22 linked file, direct-syscall, TCP, and sole-M blocking-pipe binaries
  • 500 direct-file, 200 standard-file, 200 TCP, and 100 blocking-pipe independent-process stress run

31-run AB/BA medians for 500 operations versus this PR parent:

  • direct syscall file: 5.379 ms -> 2.240 ms (-58.4%)
  • standard os.File: 8.772 ms -> 5.556 ms (-36.7%)
  • TCP: 20.454 ms -> 20.372 ms (neutral)

The remaining source-free direct-channel cross-route dependency is documented explicitly: its completed producer request should activate a deferred replacement, rather than treating every unmatched channel waiter as eager syscall demand.

@cpunion
cpunion merged commit a9bb968 into llvm-coro Aug 14, 2026
14 checks passed
@cpunion
cpunion deleted the coro/io-perf-root-20260814 branch August 14, 2026 13:43
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