4 ms·
9p works from OSes other than Linux; there's a driver for Windows as well. That said, it will likely always work best in Linux. Unfortunately, even over virti
by JoshTriplett 12y ago
9p works from OSes other than Linux; there's a driver for Windows as well. That said, it will likely always work best in Linux. Unfortunately, even over virtio, 9p has awful performance.
> The remaining alternative is on-demand synthesis of a block image given a directory tree, which IIRC Qemu supports.
If you mean vvfat, that hasn't worked in quite a while, and it never supported writes.
> If you're running a Linux host, and you want ultra-quick dev machine booted from your filesystem, User Mode Linux already exists and has way more support and flexibility.
UML tends to bitrot; it's hit or miss whether it even compiles in each new release, and it doesn't get any significant new development. It also relies on ptracing the target process, which is rather awful; unfortunately there's no better way to implement userspace syscalls.
I wonder if UML could be accelerated by adding some new features to the BPF-based seccomp to support syscall emulation? BPF could translate each syscall into some efficient communication to the UML kernel process.
Alternatively, with a 64-bit address space available, UML could learn to do its own memory and process management, and not rely on host Linux processes at all.
- _wmd 12y agoI imagine seccomp and ptrace have pretty similar performance, since they both wake the 'host' using a signal, and stay out of the way until their trigger is met. As for UML stability, Debian have been providing packages of it for years, I can't remember the last time I built it directly.
- kijiki 12y agoCould you elaborate on 9p/virtio performance? I've had pretty good results booting qemu/kvm VMs with 9p root filesystems... UML used to have some host kernel patches that were a lot faster for intercepting syscalls. There was never enough interest (even before Vanderpool/Pacifica) to merge it though.
- JoshTriplett 12y ago> Could you elaborate on 9p/virtio performance? I've had pretty good results booting qemu/kvm VMs with 9p root filesystems... The throughput is passable, if you do large enough reads; however, the latency for individual operations is terrible. Try booting via virtio-9p and building a kernel inside the virtual machine, as compared to the host system. Last time I tried it, it took several orders of magnitude longer, due in large part to the latency of simple operations like stat or open/read/close.
- 4ad 12y agoOn high-latency links, 9P is slow, but on low latency links (like should be provided by QEMU), 9P should be very fast. Looks like a QEMU implementation problem to me. That being said, calling QEMU's 9P "9P", is a stretch. 9P was designed wit multiplexing in mind, but it's not multiplexed in QEMU, in fact multiplexing in QEMU uses a completely different mechanism. You can't mount QEMU's thing in Plan 9 (unless someone added support for this when I wasn't looking).
- JoshTriplett 12y agoI wouldn't find it surprising at all if the fault lies with qemu's implementation rather than with some inherent property of 9p. The performance test I ran was with qemu's virtio 9p implementation: compared to a kernel compile on the host, one in the guest took a few percent longer on a virtual block device, or hundreds of times longer on virtio-9p.
- stefanha 12y ago> 9p works from OSes other than Linux; there's a driver for Windows as well. Do you have a link to the Windows virtio 9p driver? I'm not aware of such a thing existing.
- JoshTriplett 12y agohttps://code.google.com/p/ninefs/ https://code.google.com/p/ninefs/ . I don't know if it supports the virtio transport, but there's a Windows virtio base driver, so it likely wouldn't be difficult to adapt ninefs to use that.