summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/kernel.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-11-13 02:25:59 +0000
committergVisor bot <gvisor-bot@google.com>2020-11-13 02:25:59 +0000
commit4ad47eb13ee2d819e61b97c796e844cee75a60c5 (patch)
tree4aa8070febff5f0fddc3c3f4eac2cd7c04fb2c56 /pkg/sentry/kernel/kernel.go
parent04ef4f2fedb11ff4abb34f5c91794a9832e68967 (diff)
parent62db1fad2cb7d2249720e157aa79c84b7531a2e9 (diff)
Merge release-20201030.0-79-g62db1fad2 (automated)
Diffstat (limited to 'pkg/sentry/kernel/kernel.go')
-rw-r--r--pkg/sentry/kernel/kernel.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/kernel.go b/pkg/sentry/kernel/kernel.go
index 1ecf76b2b..2cdcdfc1f 100644
--- a/pkg/sentry/kernel/kernel.go
+++ b/pkg/sentry/kernel/kernel.go
@@ -1359,6 +1359,13 @@ func (k *Kernel) SendContainerSignal(cid string, info *arch.SignalInfo) error {
// not have meaningful trace data. Rebuilding here ensures that we can do so
// after tracing has been enabled.
func (k *Kernel) RebuildTraceContexts() {
+ // We need to pause all task goroutines because Task.rebuildTraceContext()
+ // replaces Task.traceContext and Task.traceTask, which are
+ // task-goroutine-exclusive (i.e. the task goroutine assumes that it can
+ // access them without synchronization) for performance.
+ k.Pause()
+ defer k.Unpause()
+
k.extMu.Lock()
defer k.extMu.Unlock()
k.tasks.mu.RLock()