]> Cypherpunks repositories - gostls13.git/commit
runtime: lock-free fast path for mark bits allocation
authorAustin Clements <austin@google.com>
Sun, 18 Dec 2016 03:07:27 +0000 (22:07 -0500)
committerAustin Clements <austin@google.com>
Mon, 6 Mar 2017 18:40:26 +0000 (18:40 +0000)
commit2ef88f7fcf5cebccdf9a20a5af6a374864ccf149
tree34462d2a6b5ff2cfa7be25aff253c3779b58a9e1
parent6c4a8d195b627bf216c6cd22e8237c6faf99cad5
runtime: lock-free fast path for mark bits allocation

Currently we acquire a global lock for every newMarkBits call. This is
unfortunate since every span sweep operation calls newMarkBits.

However, most allocations are simply linear allocations from the
current arena. Take advantage of this to add a lock-free fast path for
allocating from the current arena. With this change, the global lock
only protects the lists of arenas, not the free offset in the current
arena.

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