diff options
author | Adin Scannell <ascannell@google.com> | 2018-10-30 22:45:51 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-10-30 22:46:42 -0700 |
commit | 0091db9cbddb6c9fb4c96fbde980780c98006eda (patch) | |
tree | 0cb33cdebd9c93202780ab8a6a195b106d9e8eca /pkg/sentry/platform | |
parent | 245d81561b521bb94e3aa88fb704b967b023b0f1 (diff) |
kvm: use private futexes.
Use private futexes for performance and to align with other runtime uses.
PiperOrigin-RevId: 219422634
Change-Id: Ief2af5e8302847ea6dc246e8d1ee4d64684ca9dd
Diffstat (limited to 'pkg/sentry/platform')
-rw-r--r-- | pkg/sentry/platform/kvm/machine_unsafe.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/sentry/platform/kvm/machine_unsafe.go b/pkg/sentry/platform/kvm/machine_unsafe.go index 4f5b01321..38c1f102f 100644 --- a/pkg/sentry/platform/kvm/machine_unsafe.go +++ b/pkg/sentry/platform/kvm/machine_unsafe.go @@ -88,7 +88,7 @@ func (c *vCPU) notify() { _, _, errno := syscall.RawSyscall6( syscall.SYS_FUTEX, uintptr(unsafe.Pointer(&c.state)), - linux.FUTEX_WAKE, + linux.FUTEX_WAKE|linux.FUTEX_PRIVATE_FLAG, ^uintptr(0), // Number of waiters. 0, 0, 0) if errno != 0 { @@ -106,7 +106,7 @@ func (c *vCPU) waitUntilNot(state uint32) { _, _, errno := syscall.Syscall6( syscall.SYS_FUTEX, uintptr(unsafe.Pointer(&c.state)), - linux.FUTEX_WAIT, + linux.FUTEX_WAIT|linux.FUTEX_PRIVATE_FLAG, uintptr(state), 0, 0, 0) if errno != 0 && errno != syscall.EINTR && errno != syscall.EAGAIN { |