Closed
Description
One of the largest remaining contributors to GC STW time is stack rescanning. I have an approach for eliminating this entirely. This is a tracking bug for implementing this approach.
I will upload a design document and proof soon, and I have a working implementation that I plan to have cleaned up and mailed out in a day or two.
I'm marking this Go 1.9. My current plan is to get the change in for Go 1.8, but have a GODEBUG flag to fall back to the current algorithm for debugging purposes (and in case something goes wrong). Assuming things go smoothly, we'll actually rip out the stack rescanning code when Go 1.9 opens.
Edit: Design doc
Edit: Things to follow up on in Go 1.9+:
- Remove stack rescanning
- Remove (or replace) stack barriers and delete TestStackBarrierProfiling
- Remove
debug.gcrescanstacks
(Go 1.12, 198440c) - Fix early mark termination race (Go 1.12, runtime: simplify mark termination and eliminate mark 2 #26903)
- Remove work draining from mark termination and
work.helperDrainBlock
(Go 1.12, runtime: simplify mark termination and eliminate mark 2 #26903) - Revisit 100us wait in
stopTheWorldWithSema
(should happen as part of non-cooperative preemption) - Revisit making the second shade conditional (and the condition for channel ops)
/cc @RLH