vmm: add prefault option in memory and memory-zone

The argument `prefault` is provided in MemoryManager, but it can
only be used by SGX and restore.
With prefault (MAP_POPULATE) been set, subsequent page faults will
decrease during running, although it will make boot slower.

This commit adds `prefault` in MemoryConfig and MemoryZoneConfig.
To resolve conflict between memory and restore, argument
`prefault` has been changed from `bool` to `Option<bool>`, when
its value is None, config from memory will be used, otherwise
argument in Option will be used.

Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com>
This commit is contained in:
Yu Li
2021-09-29 12:54:22 +08:00
committed by Sebastien Boeuf
parent 90d79fa76b
commit 08021087ec
5 changed files with 54 additions and 13 deletions

View File

@@ -546,6 +546,9 @@ components:
hotplugged_size:
type: integer
format: int64
prefault:
type: boolean
default: false
MemoryConfig:
required:
@@ -577,6 +580,9 @@ components:
hugepage_size:
type: integer
format: int64
prefault:
type: boolean
default: false
zones:
type: array
items: