From 653426f08f2e34ddcc73f7603d23e5f640b6b1ff Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Thu, 19 Mar 2015 17:46:18 -0400 Subject: [PATCH] runtime: exit getfull barrier if there are partial workbufs Currently, we only exit the getfull barrier if there is work on the full list, even though the exit path will take work from either the full or partial list. Change this to exit the barrier if there is work on either the full or partial lists. I believe it's currently safe to check only the full list, since during mark termination there is no reason to put a workbuf on a partial list. However, checking both is more robust. Change-Id: Icf095b0945c7cad326a87ff2f1dc49b7699df373 Reviewed-on: https://go-review.googlesource.com/7840 Reviewed-by: Rick Hudson --- src/runtime/mgcwork.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/mgcwork.go b/src/runtime/mgcwork.go index 970020ece4..ecf603a739 100644 --- a/src/runtime/mgcwork.go +++ b/src/runtime/mgcwork.go @@ -419,7 +419,7 @@ func getfull(entry int) *workbuf { xadd(&work.nwait, +1) for i := 0; ; i++ { - if work.full != 0 { + if work.full != 0 || work.partial != 0 { xadd(&work.nwait, -1) b = (*workbuf)(lfstackpop(&work.full)) if b == nil { -- 2.48.1