• Austin Clements's avatar
    runtime: lock-free fast path for mark bits allocation · 2ef88f7f
    Austin Clements authored
    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: 's avatarRick Hudson <rlh@golang.org>
    2ef88f7f
mheap.go 43.7 KB