]> Cypherpunks repositories - gostls13.git/commit
runtime: steal the correct amount of GC assist credit
authorAustin Clements <austin@google.com>
Wed, 22 Jul 2015 20:40:50 +0000 (16:40 -0400)
committerAustin Clements <austin@google.com>
Mon, 27 Jul 2015 19:58:54 +0000 (19:58 +0000)
commitb8526a83804fa3e75ee3fc2a3a55f27791f6bd8f
treec356c99e5cc6b65f78c6dead189a57a84b98f260
parent129cfa2745a3db0fd55fd13fd46da0e75b9ce7dc
runtime: steal the correct amount of GC assist credit

GC assists are supposed to steal at most the amount of background GC
credit available so that background GC credit doesn't go negative.
However, they are instead stealing the *total* amount of their debt
but only claiming up to the amount of credit that was available. This
results in draining the background GC credit pool too quickly, which
results in unnecessary assist work.

The fix is trivial: steal the amount of work we meant to steal (which
is already computed).

Change-Id: I837fe60ed515ba91c6baf363248069734a7895ef
Reviewed-on: https://go-review.googlesource.com/12643
Reviewed-by: Rick Hudson <rlh@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/mgcmark.go