]> Cypherpunks repositories - gostls13.git/commit
runtime: add mayAcquire annotation for finlock
authorAustin Clements <austin@google.com>
Wed, 20 Jul 2022 19:06:31 +0000 (15:06 -0400)
committerAustin Clements <austin@google.com>
Thu, 4 Aug 2022 15:31:46 +0000 (15:31 +0000)
commitd29a0282e9b7340ba2ed3f506e66304e92580238
tree2be3cf0a6a7dee0569fb86f95a0ed13870ab2391
parentc5be4ed7df3b2ae8f9d0a5c85afa4cf49e22a56d
runtime: add mayAcquire annotation for finlock

We're missing lock edges to finlock that happen only rarely. Anything
that calls mallocgc can potentially trigger sweeping, which can
potentially queue a finalizer, which acquires finlock. While this can
happen on any malloc, it happens relatively rarely, so we simply
haven't seen some of the lock edges that could happen.

Add a mayAcquire annotation to mallocgc to capture the possibility of
acquiring finlock.

With this change, we add "fin" to the set of "malloc" locks. Several
of these edges were already there, but not quite all of them.

This was found by inspecting the rank graph for things that didn't
make sense.

For #53789.

Change-Id: Idc10ce6f250596b0c07ba07ac93f2198fb38c22b
Reviewed-on: https://go-review.googlesource.com/c/go/+/418717
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/runtime/lockrank.go
src/runtime/malloc.go
src/runtime/mfinal.go
src/runtime/mklockrank.go