Commit Graph

10 Commits

Author SHA1 Message Date
gVisor bot b3f49ebd74 Merge release-20191114.0-18-gc0f89eb (automated) 2019-11-21 19:43:52 +00:00
Adin Scannell c0f89eba6e Import and structure cleanup.
PiperOrigin-RevId: 281795269
2019-11-21 11:41:30 -08:00
gVisor bot e7f30113e2 Merge release-20190806.1-360-g5694bd0 (automated) 2019-11-01 18:47:47 +00:00
Jamie Liu 5694bd080e Don't log "p9.channel.service: flipcall connection shutdown".
This gets quite spammy, especially in tests.

PiperOrigin-RevId: 277970468
2019-11-01 11:45:02 -07:00
gVisor bot e14a0a36cb Merge release-20190806.1-143-ga8834fc (automated) 2019-09-13 06:41:23 +00:00
Michael Pratt df5d377521 Remove go_test from go_stateify and go_marshal
They are no-ops, so the standard rule works fine.

PiperOrigin-RevId: 268776264
2019-09-12 15:10:17 -07:00
Jamie Liu 9e1cbdf565 Indicate flipcall synchronization to the Go race detector.
Since each Endpoint has a distinct mapping of the packet window, the Go race
detector does not recognize accesses by connected Endpoints to be related. This
means that this change isn't necessary for the Go race detector to accept
accesses of flipcall.Endpoint.Data(), but it *is* necessary for it to accept
accesses to shared variables outside the scope of flipcall that are
synchronized by flipcall.Endpoint state; see updated test for an example.

RaceReleaseMerge is needed (instead of RaceRelease) because calls to
raceBecomeInactive() from *unrelated* Endpoints can occur in any order.
(DowngradableRWMutex.RUnlock() has a similar property: calls to RUnlock() on
the same DowngradableRWMutex from different goroutines can occur in any order.
Remove the TODO asking to explain this now that this is understood.)

PiperOrigin-RevId: 267705325
2019-09-06 17:25:07 -07:00
Jamie Liu eb94066ef2 Ensure that flipcall.Endpoint.Shutdown() shuts down inactive peers.
PiperOrigin-RevId: 267022978
2019-09-03 15:10:51 -07:00
Jamie Liu cbe145247a Flipcall refinements.
Note that some of these changes affect the protocol in
backward-incompatible ways.

- Replace use of "initially-active" and "initially-inactive" with
"client" and "server" respectively for clarity.

- Fix a race condition involving Endpoint.Shutdown() by repeatedly
invoking FUTEX_WAKE until it is confirmed that no local thread is
blocked in FUTEX_WAIT.

- Drop flipcall.ControlMode.

PiperOrigin-RevId: 260981382
2019-07-31 12:56:04 -07:00
Jamie Liu e806466fc5 Add //pkg/flipcall.
Flipcall is a (conceptually) simple local-only RPC mechanism. Compared
to unet, Flipcall does not support passing FDs (support for which will
be provided out of band by another package), requires users to establish
connections manually, and requires user management of concurrency since
each connected Endpoint pair supports only a single RPC at a time;
however, it improves performance by using shared memory for data
(reducing memory copies) and using futexes for control signaling (which
is much cheaper than sendto/recvfrom/sendmsg/recvmsg).

PiperOrigin-RevId: 254471986
2019-06-21 14:47:04 -07:00