]> Cypherpunks repositories - gostls13.git/commit
runtime: cache one GC workbuf in thread-local storage
authorDmitriy Vyukov <dvyukov@google.com>
Tue, 5 Aug 2014 21:50:37 +0000 (01:50 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Tue, 5 Aug 2014 21:50:37 +0000 (01:50 +0400)
commitf6f2f77142fcf0a4ec317bff6850ffb6ee6f0bb2
treeb56dd602fe37ab281e8739cca8295038ba5c1d60
parent22e08d1a3b6fba51df3bcad9a5f0d70fefd0412d
runtime: cache one GC workbuf in thread-local storage
We call scanblock for lots of small root pieces
e.g. for every stack frame args and locals area.
Every scanblock invocation calls getempty/putempty,
which accesses lock-free stack shared among all worker threads.
One-element local cache allows most scanblock calls
to proceed without accessing the shared stack.

LGTM=rsc
R=golang-codereviews, rlh
CC=golang-codereviews, khr, rsc
https://golang.org/cl/121250043
src/pkg/runtime/malloc.h
src/pkg/runtime/mcache.c
src/pkg/runtime/mgc0.c