Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Copy out-bound data into pre-shared pages #17
The original motivation for this is to make TLS support work. Currently, TLS copies the encrypted buffers into a large Io_page, and TCP then sends segment-sized Cstruct views of this buffer to the network. If any of these overlap a page boundary, the send will fail.
With this patch, TLS can send ordinary unaligned buffers to TCP (avoiding a copy). The copy now happens in Netif.
This some other advantages:
Performance of UDP benchmark on ARM:
The panic may be because I'm running a patched kernel to work around previous crashes, so I don't think it's worth reporting it. We should upgrade the ARM image builder to a newer stock kernel at some point. I also saw the old code once cause a dom0 kernel panic on x86_64 (which, unfortunately, I didn't capture because serial logging wasn't on), but that's also running a patched kernel.
So, I think the new code should be better for older (and possibly newer) Linux kernels too.
The original motivation for this is to make TLS support work. Currently, TLS copies the encrypted buffers into a large Io_page and TCP sends segment-sized Cstruct views of this buffer to the network. If any of these overlap a page boundary, the send will fail. With this patch, TLS can send ordinary unaligned buffers to TCP (avoiding a copy). The copy now happens in Netif. This some other advantages: - It avoids splitting requests across multiple grants (before, we sent the IP header and payload in separate pages). - It avoids the security problem of sharing unrelated data that happens to be in the same page. Now, netback will only ever see data explicitly sent to it. - It allows the sender to reuse pages as soon as Netif.write returns. Before, the pages were queued and the application could change them even as netback was reading them. Behaviour should now be deterministic. - It's faster (132 MB/s -> 181 MB/s for an x86_64 unikernel running under Xen in VirtualBox on my laptop).
I think we can drop 4.00.
On Thu, Jan 15, 2015 at 3:11 PM, Thomas Leonard email@example.com
``` val blitv: t list -> t -> int * t list (** [blitv src dst] will copy the list of [src] buffers into [dst] and return a tuple of the total number of bytes written and a list of any uncopied buffers. [blitv] will never raise an exception, since it returns any uncopied bytes if the [dst] buffer is not big enough to fit the full list of [src] buffers. *) ``` via @talex5 in mirage/mirage-net-xen#17
I think this code contains a deadlock/race. Not sure exactly where yet, but with @MagnusS we managed to bisect the 30% SYNACK losses in synjitsu to that commit (or the one later which tries to fix the deadlock, not totally sure).
A working trace:
A failing trace:
The interesting bits being the