XenFS Sharing data in a virtualised environment Mark Williamson University of Cambridge mark.williamson@cl.cam.ac.uk
Overview Introduction to Xen Why share filesystems in a VMM? Limitations of existing methods XenFS will save the world! Status and further work
Xen Paravirtualised hypervisor for x86 Domain 0 (privileged) Unprivileged domain Unprivileged domain Device drivers Virtual devices Virtual devices Xen Paravirtualised hypervisor for x86 Run device drivers in privileged virtual machines Use inter-VM communication for virtual devices Terminology: Domain == running VM Domain 0 == Privileged VM Virtualise through dom0 for unprivileged machines' devices
Virtual devices under Xen Domain 0 Guest Requests Shared ringbuffer Backend Frontend Reponses Event notifications Event notifications Ringbuffer in shared memory Transfer data using DMA / transient shared mappings / page transfers, depending on the context Xen
Filesystem sharing under Xen Good for administration, efficiency, etc. Main options: Share at block level (inflexible but fast) Share via network filesystem (inefficient) Want (at least) the performance of block-level sharing but NFS-style flexibility
XenFS: the concept Virtualisation-aware shared filesystem Use shared memory directly as a data transport: Filesystem best placed to optimise data transfers Maximise performance Eliminate duplicated IO and in-memory data May perform better than existing virtual IO Page sharing, page flipping, events NFS is our rolemodel, usage-wise Block-device is our target performance
XenFS: planned features Export directory hierachies from server Multiple modes of operation: FS-level Copy on Write (Reasonably) coherent writable sharing interdomain shared memory (mmap shared files) Unify IO caching across the whole host
XenFS: Read mechanism Minimal overheads Page Client Server Page IO request Sharing reference Fetch Data Shared page Shared page Shared page Page IO Request Page Minimal overheads Share identical memory directly Eliminate unnecessary disk IO No modification to core OS page-cache Sharing reference Client 2
XenFS: status Read-only prototype with page transfer / sharing Rewriting for this week's Xen control interface :-) Page frame reclamation: designed, no code yet Coherent writing mechanisms: but be efficient Live migration: soft state in the server Benchmarking: XenFS vs NFS vs Block device
Summary Sharing data is important in a virtualised system Filesystem sharing is an opportunity to improve on block IO Virtualising the filesystem gives flexibility & performance
Questions?
XenFS: Undoing sharing Problem: Guests may try to write shared frames: Modify private copy of data Reallocated page cache frames Solution: Mechanism to reclaim memory from server New kind of fault: “Copy To Write” Flip side of the coin: how to undo the sharing established by a read
XenFS: “Copy To Write” Faults Private copy Copy data Guest attempting to transition a shared page to writable Fault handler runs Shared page Client Server Reclaim request Empty page Ack CTW Fault from hypervisor Page Rewrite page tables to point to private copy – transparent to the rest of kernel