Repository navigation
ps2link: Send each fileio write as one request with one reply - #69
Merged
Merged
Conversation
pko_write_file split every write into PKO_MAX_WRITE_SEGMENT (1448 byte) pieces and waited for a PKO_WRITE_RLY after each one, so writes to host: cost a network round trip per 1448 bytes. ps2client already reads a write request's nbytes from the socket whatever their size, so send one request header for the whole length, the data straight from the caller's buffer, and wait for one reply (checked as before). On a PS2 (ps2link over Ethernet to ps2client on Linux), one fileio WRITE call of 32 KiB from the EE goes from 40.7 ms to 22.5 ms, and the sustained write rate from 0.80 MB/s to 1.46 MB/s at every size from 16 KiB to 256 KiB. Reads are unchanged (2.1 MB/s). The ZEROCOPY option only chose between copying each segment into the packet buffer or sending it in place; the data is now always sent in place, so the option is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pko_write_filesplit every write intoPKO_MAX_WRITE_SEGMENT(1448 byte) pieces and waited for aPKO_WRITE_RLYafter each one, so writes tohost:cost a network round trip per 1448 bytes. ps2client already reads a write request'snbytesfrom the socket whatever their size (ps2link_request_write, with a heap buffer above 64 KiB). So this sends one request header for the whole length, then the data straight from the caller's buffer, then waits for one reply. The reply is checked as before (pko_fileio_write_progress_valid, now against the whole length).The
ZEROCOPYoption only chose between copying each segment into the packet buffer and sending it in place. The data is now always sent in place, so the option is removed from both Makefiles.Measured
Real PS2 over Ethernet, ps2client on Linux. One fileio call from the EE per size, 1 MiB per size, data read back and checked:
Tested
tests/fileio_reply.candtests/exception_packet.cpass.LOADHIGH=1builds.LOADHIGH=1build started from the installed ps2link, then writes and reads of 4 KiB–256 KiB throughhost:with the data checked.🤖 Generated with Claude Code