]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: move malloc stats into consistentHeapStats
authorMichael Anthony Knyszek <mknyszek@google.com>
Tue, 4 Aug 2020 17:29:03 +0000 (17:29 +0000)
committerMichael Knyszek <mknyszek@google.com>
Mon, 26 Oct 2020 18:28:56 +0000 (18:28 +0000)
commit79781e8dd382ac34e502ed6a088dff6860a08c05
tree37ad5dea76bd2dabfb360c05e6e9f040220a9739
parentf77a9025f1e4bf4bb3e2b582d13cce5f19c1ca51
runtime: move malloc stats into consistentHeapStats

This change moves the mcache-local malloc stats into the
consistentHeapStats structure so the malloc stats can be managed
consistently with the memory stats. The one exception here is
tinyAllocs for which moving that into the global stats would incur
several atomic writes on the fast path. Microbenchmarks for just one CPU
core have shown a 50% loss in throughput. Since tiny allocation counnt
isn't exposed anyway and is always blindly added to both allocs and
frees, let that stay inconsistent and flush the tiny allocation count
every so often.

Change-Id: I2a4b75f209c0e659b9c0db081a3287bf227c10ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/247039
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/runtime/export_test.go
src/runtime/malloc.go
src/runtime/mcache.go
src/runtime/mgcsweep.go
src/runtime/mstats.go
src/runtime/proc.go