Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
runtime: add Gscan to the lock ranking order #38922
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.