Skip to content

execution/execmodule: run a due GC right after a block commit - #26691

Closed
awskii wants to merge 7 commits into
mainfrom
awskii/gc-after-block-commit
Closed

awskii wants to merge 7 commits into
mainfrom
awskii/gc-after-block-commit

Conversation

@awskii

@awskii awskii commented Nov 23, 2026

Copy link
Copy Markdown
Member
  • A GC whose mark tail overlaps newPayload parks every unique.Make miss in "GC weak to strong wait". Go keeps that block across gcMarkDone restarts.
  • After the FCU commit and overlay teardown, one goroutine runs runtime.GC() once half the runway is used, before the earliest pacer trigger (45/64).
  • Blocked by diagnostics/mem: cap the smaps_rollup read in the [mem] logger #26690 (stacked). Draft: A/B running.
value
arb1-dev trace: 19 goroutines parked 56.7–57.7 ms
repro, unique.Make max 129 ms (strong map: 22 ms)

@AskAlexSharov AskAlexSharov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. execution/execmodule/idle_after_commit.go L32: bugs the goroutine reads smaps_rollup before it decides on the GC. About once per 30 min that read takes ~1 s (as measured in #26690), so the forced GC starts ~1 s after the commit and can overlap the next newPayload, the overlap this PR wants to avoid. Call e.gcIfDue() first, then mem.RefreshVirtualMemStats(...).
  2. execution/execmodule/idle_after_commit.go L58: idiom runway/64*45 is a private copy of the runtime pacer's minTriggerRatioNum/triggerRatioDen (mgcpacer.go), and only the test's variable name says so. Use named constants (pacerMinTriggerNum, pacerTriggerDen = 45, 64) with a one-line comment that they mirror the runtime's earliest pacer trigger.
  3. execution/execmodule/forkchoice.go L956: speed a forced GC at half the runway can nearly double GC cycles (a natural GC triggers between 0.7 and 0.95 of the runway), and on proposer slots its mark overlaps block building, which starts right after the FCU reply. Before ready, the A/B should show newPayload p50/p99, GC cycles per hour, GC CPU share and getPayload time.

Base automatically changed from awskii/mem-smaps-rare to main November 23, 2026 05:41
@awskii
awskii marked this pull request as ready for review November 23, 2026 07:04
@awskii
awskii marked this pull request as draft November 23, 2026 07:26
@awskii

awskii commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

Closing: a live A/B on a mainnet tip node shows no gain.

  • At default GOGC the rule never fired: 0 forced GCs in 80 min of the on arm, and GC count and GC CPU were the same in both arms.
  • At GOGC=25 it fired, and the medians got worse.
arb1-dev v3ref, 2026-11-23, windows ABAB off on change test
GOGC=25, 4 × 30 min: newPayload median 23.29 ms 25.26 ms +8.4% MW 2v2 windows, incomplete
GOGC=25: commitment median 2.977 ms 3.233 ms +8.6% MW 2v2 windows, incomplete
GOGC=25: GC cycles per block 0.10 0.14 +40%
default GOGC, 4 × 45 min: forced GCs 0 gctrace
all 8 windows: newPayload median 24.79 ms 25.1 ms +1.3% MW 4v4 windows, p .49

Measured head d8b8864be5b; b0c2a2ae8be keeps the same trigger rule. The smaps change merged separately as #26690.

@awskii awskii closed this Nov 23, 2026
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