Skip to content

MSG_ZEROCOPY + non-temporal stores from AES-GCM#3007

Merged
kazuho merged 81 commits into
masterfrom
kazuho/msg_zerocopy
Jul 1, 2022
Merged

MSG_ZEROCOPY + non-temporal stores from AES-GCM#3007
kazuho merged 81 commits into
masterfrom
kazuho/msg_zerocopy

Conversation

@kazuho

@kazuho kazuho commented Apr 25, 2022

Copy link
Copy Markdown
Member

For sending encrypted bytes to the socket with minimal overhead in terms of both memory bandwidth and CPU clock cycles, uses MSG_ZEROCOPY and non-temporal aes-gcm engine (h2o/picotls#384).

  • Do not mix buffers passed to kernel with MSG_ZEROCOPY and those that are not. At the moment, they share the same allocator: h2o_socket_ssl_buffer_allocator (done in 9bcf40f).
  • Reduce threshold for zerocopy from 16KB to 4KB or something. https://www.kernel.org/doc/html/v5.17/networking/msg_zerocopy.html recommends 10KB but we probably want to use a smaller number, especially when using non-temporal engine and tx-nocache-copy, in which case both the source and destination of the copy becomes main memory (done in 4cba163).
  • Consult if zerocopy is actually used, and report if non-use rate is high. It's too easy to screw up configuration. -> This to be done in a follow-up PR.

Builds on top of h2o/picotls#384, #3031.

@kazuho kazuho changed the title MSG_ZEROCOPY MSG_ZEROCOPY + non-temporal stores from AES-GCM May 11, 2022
@kazuho
kazuho marked this pull request as ready for review July 1, 2022 05:56
@kazuho
kazuho merged commit 16d0c19 into master Jul 1, 2022
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.

2 participants