3 ms·
How is backpressure handled in the SOCKMAP solution? The description sounds like it just attaches all incoming buffers to the outgoing part of the socket irresp
by Matthias247 8y ago
How is backpressure handled in the SOCKMAP solution? The description sounds like it just attaches all incoming buffers to the outgoing part of the socket irrespective of the number of already buffered data. That could be bad, if it means the memory usage is unbounded.
The other solutions definitely all would block if the send buffer is full.
Apart from that question it was interesting to learn that io_submit actually works on sockets too. I definitely need to read more about this one.
- majke 8y agoThere are couple of interesting question: - backpressure - what if both userspace and SOCKMAP are doing read() on a socket? - can one use SOCKMAP to splice only a selected amount of data, and pick up the rest with read() - What are the parser/verdict program semantics. What can they do. - what is the SK_MSG abstraction, and how to benefit from it. and more... some of this is discussed: http://vger.kernel.org/lpc_net2018_talks/ktls_bpf_paper.pdf http://vger.kernel.org/lpc_net2018_talks/ktls_bpf_paper.pdf On io_submit, we wrote about it here: https://blog.cloudflare.com/io_submit-the-epoll-alternative-youve-never-heard-about/ https://blog.cloudflare.com/io_submit-the-epoll-alternative-... TLDR: it allows for batching, and with IOCB_CMD_POLL can be used as epoll alternative.
- Matthias247 8y agoThanks for all the articles! I read the one about io_submit in the meantime. I actually hoped it would be as async as the API suggests, so it seems a bit disappointing for my use-case. Do you know if when I would schedule multiple writes via io_submit, whether it would block until all sockets have written something, or only until at least one has written something? I guess the fact that one has to guess and try how those APIs behave makes me most nervous and would make me prevent from using those. An async IO system should be very well-behaved, and not block at arbitrary points.