]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix sudog leak in syncsemrelease
authorRuss Cox <rsc@golang.org>
Mon, 10 Nov 2014 01:21:03 +0000 (20:21 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 10 Nov 2014 01:21:03 +0000 (20:21 -0500)
Manifested as increased memory usage in a Google production system.

Not an unbounded leak, but can significantly increase the number
of sudogs allocated between garbage collections.

I checked all the other calls to acquireSudog.
This is the only one that was missing a releaseSudog.

LGTM=r, dneil
R=dneil, r
CC=golang-codereviews
https://golang.org/cl/169260043

src/runtime/sema.go

index a42a29988a380874317d8e92bbcabddbb171fe6c..d2a028c01b1fe9f5e5332dd915fa11a201db7f11 100644 (file)
@@ -259,6 +259,7 @@ func syncsemrelease(s *syncSema, n uint32) {
                }
                s.tail = w
                goparkunlock(&s.lock, "semarelease")
+               releaseSudog(w)
        } else {
                unlock(&s.lock)
        }