mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: memory: Add prefault option when creating region
When CoW can be used, the VM restoration time is reduced, but the pages are not populated. This can lead to some slowness from the guest when accessing these pages. Depending on the use case, we might prefer a slower boot time for better performances from guest runtime. The way to achieve this is to prefault the pages in this case, using the MAP_POPULATE flag along with CoW. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -360,9 +360,13 @@ impl Vm {
|
||||
vmm_path: PathBuf,
|
||||
) -> Result<Self> {
|
||||
let (kvm, fd) = Vm::kvm_new()?;
|
||||
let memory_manager =
|
||||
MemoryManager::new(fd.clone(), &config.lock().unwrap().memory.clone(), None)
|
||||
.map_err(Error::MemoryManager)?;
|
||||
let memory_manager = MemoryManager::new(
|
||||
fd.clone(),
|
||||
&config.lock().unwrap().memory.clone(),
|
||||
None,
|
||||
false,
|
||||
)
|
||||
.map_err(Error::MemoryManager)?;
|
||||
|
||||
Vm::new_from_memory_manager(
|
||||
config,
|
||||
|
||||
Reference in New Issue
Block a user