mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Make Transparent Huge Pages controllable (default on)
Add MemoryConfig::thp and `--memory thp=on|off` to allow control of Transparent Huge Pages. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
@@ -139,6 +139,10 @@ impl Default for HotplugMethod {
|
||||
}
|
||||
}
|
||||
|
||||
fn default_memoryconfig_thp() -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
|
||||
pub struct MemoryConfig {
|
||||
pub size: u64,
|
||||
@@ -160,6 +164,8 @@ pub struct MemoryConfig {
|
||||
pub prefault: bool,
|
||||
#[serde(default)]
|
||||
pub zones: Option<Vec<MemoryZoneConfig>>,
|
||||
#[serde(default = "default_memoryconfig_thp")]
|
||||
pub thp: bool,
|
||||
}
|
||||
|
||||
pub const DEFAULT_MEMORY_MB: u64 = 512;
|
||||
@@ -177,6 +183,7 @@ impl Default for MemoryConfig {
|
||||
hugepage_size: None,
|
||||
prefault: false,
|
||||
zones: None,
|
||||
thp: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user