]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: exit getfull barrier if there are partial workbufs
authorAustin Clements <austin@google.com>
Thu, 19 Mar 2015 21:46:18 +0000 (17:46 -0400)
committerAustin Clements <austin@google.com>
Fri, 20 Mar 2015 14:05:11 +0000 (14:05 +0000)
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 <rlh@golang.org>
src/runtime/mgcwork.go

index 970020ece4854ce875d5ac65f0fc53261c52bbb9..ecf603a739a5dd35b91b1db615da0a1e788d4a82 100644 (file)
@@ -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 {