Skip to content

a call sends a whole message and takes the next one back - #1135

Closed
Japabu wants to merge 1 commit into
ipc-messagesfrom
ipc-call
Closed

Japabu wants to merge 1 commit into
ipc-messagesfrom
ipc-call

Conversation

@Japabu

@Japabu Japabu commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Draft, stacked on #1121 (base ipc-messages). It needs a keep-or-drop decision before more work goes into it.

What it does

SYS_MESSAGE_CALL is SYS_MESSAGE_SEND followed by a blocking SYS_MESSAGE_RECV on the same connection, in one syscall.

  • A refused send answers as a send does, with nothing sent. Once the request is queued, the receive answers as a receive does, into the same two windows IPC phase 2: a connection carries whole messages #1121's receive takes.
  • The request carries no handles. An error could come from either half, so a caller could not know whether its handles had moved.
  • Connection::call takes the answer straight into the caller's buffer, as recv_into does.
  • Consumers: the file server's client (toyos::fs's request and reply) and osbench's ipc.reqrep rows. messages_are_whole checks that a call takes its peer's answer, with the answer's handle, split across both windows.

Why it may not earn its place

The call was meant to tell the scheduler that its caller parks next, so the callee could run where the caller leaves (WakeCause::parks_next).

Checks at 6ffcb2402

🤖 Generated with Claude Code

SYS_MESSAGE_CALL is SYS_MESSAGE_SEND and then a blocking SYS_MESSAGE_RECV on
the same connection, in one syscall. A refused send answers as a send does
with nothing sent; once the request is queued the receive answers as a
receive does, into the same two windows. A protocol whose peer answers each
request in turn makes the next message its answer. The request carries no
handles: an error could come from either half, so a caller could not know
whether they had moved.

The call no longer tells the scheduler that its caller parks next:
#1111 dropped WakeCause::parks_next (e938fe3), and #1129's waker-LLC
affinity carries the waker on every wake instead. What is left is one
syscall entry and exit per round trip.

Consumers: the file server's client (toyos::fs's request and reply) and
osbench's ipc.reqrep rows, whose request's last frame and answer's first
are one call. Connection::call takes the answer straight into the caller's
buffer, as recv_into does. messages_are_whole checks that a call takes the
answer its peer sends, with the answer's handle, split across both windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Japabu

Japabu commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

Closing this, by the orchestrator's decision.

#1111 dropped WakeCause::parks_next (e938fe3e5), so all the call has left is one syscall entry and exit per round trip. #1121's first round measured the call while it still carried that hint, on the T14 and the AMD bench:

  • it saved about one syscall on ipc.reqrep.8;
  • it saved nothing on the fs rows;
  • parks_next never reached the file server, which waits through poll delivery.

That saving does not earn a permanent syscall number and a second send path ("Code is liability").

The branch ipc-call stays at 6ffcb2402 for the record. Evidence for this head: https://github.com/ToyOSOrg/evidence/tree/05eef35125bb758d9880f5e21d48b1e40d09b193/ipc-call/6ffcb2402

@Japabu Japabu closed this Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant