-
Notifications
You must be signed in to change notification settings - Fork 112
Open
Milestone
Description
Lots of virtio code first converts descriptor chains to Vec<VolatileSlice>
, and then later converts that into Vec<iovec>
for use with readv
/ writev
, which has a nasty intermediate allocation of a vector. Firecracker works around this problem by going straight to Vec<iovec>
, and then loosing all the safety of the VolatileSlice
abstractions, which is also not great. For that reason, we'd like to slim down VolatileSlice
to get rid of all metadata, so just the pointer and length fields remain.
Currently, VolatileSlice is defined as follows:
vm-memory/src/volatile_memory.rs
Lines 393 to 398 in 3854f01
pub struct VolatileSlice<'a, B = ()> { | |
addr: *mut u8, | |
size: usize, | |
bitmap: B, | |
mmap: Option<&'a MmapInfo>, | |
} |
So what we need to move out is
- The dirty bitmap tracking: Potentially, this can be done via a decorator instead
- The Xen-only MmapInfo: This can be removed by re-framing Xen memory as an
IoMemory
implementation (instead ofGuestMemory
), as defined in I/O virtual memory (IOMMU) support #327 (the xen stuff is in VolatileSlice because in the past, that was the only place where we definitely know whether an access is a read or a write, but with IoMemory, we will have permission information way further up the stack, and can do all the Xen ioctls/mmap calls prior to VolatileSlice creation)
Metadata
Metadata
Assignees
Labels
No labels