]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.5] runtime: fix recursive GC assist
authorAustin Clements <austin@google.com>
Fri, 9 Oct 2015 21:20:34 +0000 (17:20 -0400)
committerAndrew Gerrand <adg@golang.org>
Mon, 12 Oct 2015 21:50:18 +0000 (21:50 +0000)
commitc257dfb178f00449dd344204219aad56e3e90de6
treebae4795584c9708bd011f09fba837168667f208f
parent6f21d7cc2656b70d4a756fcad60b3ba9e4c0c236
[release-branch.go1.5] runtime: fix recursive GC assist

If gcAssistAlloc is unable to steal or perform enough scan work, it
calls timeSleep, which allocates. If this allocation requires
obtaining a new span, it will in turn attempt to assist GC. Since
there's likely still no way to satisfy the assist, it will sleep
again, and so on, leading to potentially deep (not infinite, but also
not bounded) recursion.

Fix this by disallowing assists during the timeSleep.

This same problem was fixed on master by 65aa2da. That commit built on
several other changes and hence can't be directly cherry-picked. This
commit implements the same idea.

Fixes #12894.

Change-Id: I152977eb1d0a3005c42ff3985d58778f054a86d4
Reviewed-on: https://go-review.googlesource.com/15720
Reviewed-by: Rick Hudson <rlh@golang.org>
src/runtime/mgcmark.go