I'd like to check in this lock ranking update, https://go-review.googlesource.com/c/go/+/228417, that inserts the Gscan bit into the locking order. This has been in process for a while, but only just finished up now. This change is useful for documentation and checking of the ordering between locks and the Gscan bit. Just in working on this change, I've added more documentation on the almost-cycle between the Gscan bit and the hchan locks (not actually possible because the relevant G is suspended in the case of the unusual Gscan -> hchan ordering), and also ran into a possible deadlock (very unlikely) involving the paniclk and allg locks.
Since this code is only activated when GOEXPERIMENT=staticlockranking, this should be quite safe. We have a builder now that automatically runs staticlockranking for linux-amd64 on each check in.
changed the title
freeze exception: runtime: add Gscan to the lock ranking orderMay 7, 2020
The path to resolution is known, but the work has not been done.
Feedback is required from experts, contributors, and/or the community before a change can be made.
May 7, 2020