]> Cypherpunks repositories - gostls13.git/commit
runtime: flush assist credit on goroutine exit
authorAustin Clements <austin@google.com>
Fri, 1 Jul 2016 15:31:04 +0000 (11:31 -0400)
committerAustin Clements <austin@google.com>
Tue, 7 Nov 2017 18:41:14 +0000 (18:41 +0000)
commitf10d99f51da73721dd0b9ab1c03c4a868a991756
treed464ee1c0188221622aa69a68bec24cb03f06e5b
parent86cd9c11764f16a2dcc551336e3aac7ad9f78d3c
runtime: flush assist credit on goroutine exit

Currently dead goroutines retain their assist credit. This credit can
be used if the goroutine gets recycled, but in general this can make
assist pacing over-aggressive by hiding an amount of credit
proportional to the number of exited (and not reused) goroutines.

Fix this "hidden credit" by flushing assist credit to the global
credit pool when a goroutine exits.

Updates #14812.

Change-Id: I65f7f75907ab6395c04aacea2c97aea963b60344
Reviewed-on: https://go-review.googlesource.com/24703
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
src/runtime/proc.go