diff options
author | Fabricio Voznika <fvoznika@google.com> | 2020-02-25 13:42:34 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-02-25 13:44:18 -0800 |
commit | 72e3f3a3eef3a1dc02db0ff71f98a5d7fe89a6e3 (patch) | |
tree | 54d520df721a706fdffabda9e6c560b197cdee86 /pkg/sentry/mm/lifecycle.go | |
parent | 430992a67abe30dc6cb4e00822517c0aed388088 (diff) |
Add option to skip stuck tasks waiting for address space
PiperOrigin-RevId: 297192390
Diffstat (limited to 'pkg/sentry/mm/lifecycle.go')
-rw-r--r-- | pkg/sentry/mm/lifecycle.go | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/pkg/sentry/mm/lifecycle.go b/pkg/sentry/mm/lifecycle.go index 3c263ebaa..d8a5b9d29 100644 --- a/pkg/sentry/mm/lifecycle.go +++ b/pkg/sentry/mm/lifecycle.go @@ -28,16 +28,17 @@ import ( ) // NewMemoryManager returns a new MemoryManager with no mappings and 1 user. -func NewMemoryManager(p platform.Platform, mfp pgalloc.MemoryFileProvider) *MemoryManager { +func NewMemoryManager(p platform.Platform, mfp pgalloc.MemoryFileProvider, sleepForActivation bool) *MemoryManager { return &MemoryManager{ - p: p, - mfp: mfp, - haveASIO: p.SupportsAddressSpaceIO(), - privateRefs: &privateRefs{}, - users: 1, - auxv: arch.Auxv{}, - dumpability: UserDumpable, - aioManager: aioManager{contexts: make(map[uint64]*AIOContext)}, + p: p, + mfp: mfp, + haveASIO: p.SupportsAddressSpaceIO(), + privateRefs: &privateRefs{}, + users: 1, + auxv: arch.Auxv{}, + dumpability: UserDumpable, + aioManager: aioManager{contexts: make(map[uint64]*AIOContext)}, + sleepForActivation: sleepForActivation, } } @@ -79,9 +80,10 @@ func (mm *MemoryManager) Fork(ctx context.Context) (*MemoryManager, error) { envv: mm.envv, auxv: append(arch.Auxv(nil), mm.auxv...), // IncRef'd below, once we know that there isn't an error. - executable: mm.executable, - dumpability: mm.dumpability, - aioManager: aioManager{contexts: make(map[uint64]*AIOContext)}, + executable: mm.executable, + dumpability: mm.dumpability, + aioManager: aioManager{contexts: make(map[uint64]*AIOContext)}, + sleepForActivation: mm.sleepForActivation, } // Copy vmas. |