]> Cypherpunks repositories - gostls13.git/commit
runtime: fix deadlock when gctrace
authorDmitriy Vyukov <dvyukov@google.com>
Thu, 21 Aug 2014 07:46:53 +0000 (11:46 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Thu, 21 Aug 2014 07:46:53 +0000 (11:46 +0400)
commita0dbbeae6785ed7fd15feb4feb4975eded83c191
tree8018db3784aac053b54d88d9259108280d41f28a
parente249b0ffeeb36957adfde2b3ec3ab0eabea8e3ba
runtime: fix deadlock when gctrace
Calling ReadMemStats which does stoptheworld on m0 holding locks
was not a good idea.
Stoptheworld holding locks is a recipe for deadlocks (added check for this).
Stoptheworld on g0 may or may not work (added check for this as well).
As far as I understand scavenger will print incorrect numbers now,
as stack usage is not subtracted from heap. But it's better than deadlocking.

LGTM=khr
R=golang-codereviews, rsc, khr
CC=golang-codereviews, rlh
https://golang.org/cl/124670043
src/pkg/runtime/heapdump.c
src/pkg/runtime/malloc.go
src/pkg/runtime/mheap.c
src/pkg/runtime/proc.c