diff --git a/pkg/sentry/platform/systrap/BUILD b/pkg/sentry/platform/systrap/BUILD index d90633c8f..1a3864a36 100644 --- a/pkg/sentry/platform/systrap/BUILD +++ b/pkg/sentry/platform/systrap/BUILD @@ -18,18 +18,6 @@ go_template_instance( }, ) -go_template_instance( - name = "subprocess_list", - out = "subprocess_list.go", - package = "systrap", - prefix = "subprocess", - template = "//pkg/ilist:generic_list", - types = { - "Element": "*subprocess", - "Linker": "*subprocess", - }, -) - go_template_instance( name = "subprocess_refs", out = "subprocess_refs.go", @@ -64,7 +52,6 @@ go_library( "subprocess_arm64.go", "subprocess_linux.go", "subprocess_linux_unsafe.go", - "subprocess_list.go", "subprocess_pool.go", "subprocess_refs.go", "subprocess_unsafe.go", diff --git a/pkg/sentry/platform/systrap/shared_context.go b/pkg/sentry/platform/systrap/shared_context.go index 1616ab658..4fbaade8f 100644 --- a/pkg/sentry/platform/systrap/shared_context.go +++ b/pkg/sentry/platform/systrap/shared_context.go @@ -210,11 +210,6 @@ type fastPathDispatcher struct { // fastPathDisabledTS is the time stamp when the stub fast path was // disabled. It is zero if the fast path is enabled. fastPathDisabledTS atomic.Uint64 - - subprocessListMu sync.Mutex - // subprocessList contains subprocesses with at least one awake context. - // +checklocks:subprocessListMu - subprocessList subprocessList } var dispatcher fastPathDispatcher @@ -256,29 +251,9 @@ func (q *fastPathDispatcher) stubFastPathEnabled() bool { // disableStubFastPath disables the fast path over all subprocesses with active // contexts. func (q *fastPathDispatcher) disableStubFastPath() { - q.subprocessListMu.Lock() - defer q.subprocessListMu.Unlock() - - for s := q.subprocessList.Front(); s != nil; s = s.Next() { - s.contextQueue.disableFastPath() - } q.fastPathDisabledTS.Store(uint64(cputicks())) } -func (q *fastPathDispatcher) activateSubprocess(s *subprocess) { - q.subprocessListMu.Lock() - defer q.subprocessListMu.Unlock() - - q.subprocessList.PushBack(s) -} - -func (q *fastPathDispatcher) deactivateSubprocess(s *subprocess) { - q.subprocessListMu.Lock() - defer q.subprocessListMu.Unlock() - - q.subprocessList.Remove(s) -} - // deep_sleep_timeout is the timeout after which we stops polling and fall asleep. // // The value is 40µs for 2GHz CPU. This timeout matches the sentry<->stub round diff --git a/pkg/sentry/platform/systrap/subprocess.go b/pkg/sentry/platform/systrap/subprocess.go index 14d847fc4..4643c617d 100644 --- a/pkg/sentry/platform/systrap/subprocess.go +++ b/pkg/sentry/platform/systrap/subprocess.go @@ -121,7 +121,6 @@ const ( type subprocess struct { platform.NoAddressSpaceIO subprocessRefs - subprocessEntry // requests is used to signal creation of new threads. requests chan any @@ -689,14 +688,9 @@ func (s *subprocess) incAwakeContexts() { if nr > uint32(maxSysmsgThreads) { return } - if nr == 1 { - dispatcher.activateSubprocess(s) - } nr = nrMaxAwakeStubThreads.Add(1) if nr > fastPathContextLimit { - if dispatcher.stubFastPathEnabled() { - dispatcher.disableStubFastPath() - } + dispatcher.disableStubFastPath() } } @@ -705,9 +699,6 @@ func (s *subprocess) decAwakeContexts() { if nr >= uint32(maxSysmsgThreads) { return } - if nr == 0 { - dispatcher.deactivateSubprocess(s) - } nrMaxAwakeStubThreads.Add(^uint32(0)) }