]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: move mem profile sampling into m-acquired section
authorDavid Chase <drchase@google.com>
Wed, 21 Jul 2021 22:38:05 +0000 (18:38 -0400)
committerDavid Chase <drchase@google.com>
Thu, 22 Jul 2021 17:01:15 +0000 (17:01 +0000)
commitfdb45acd1f062884c77ea6961fb638e004af1b8e
treee5e241b71592c0f592cb31087e3dc78b02c56d06
parent3e48c0381fd1beb78e993e940c3b46ca9898ce6d
runtime: move mem profile sampling into m-acquired section

It was not safe to do mcache profiling updates outside the critical
section, but we got lucky because the runtime was not preemptible.
Adding chunked memory clearing (CL 270943) created preemption
opportunities, which led to corruption of runtime data structures.

Fixes #47304.
Fixes #47302.

Change-Id: I461615470d62328a83ccbac537fbdc6dcde81c85
Reviewed-on: https://go-review.googlesource.com/c/go/+/336449
Trust: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
src/runtime/malloc.go