crosvm/swap
Shintaro Kawamura 0897c87424 swap: split vmm-swap out command
This splits the `crosvm swap enable` command, which pauses the whole
crosvm processes while it write all the active pages on the guest memory
into the swap file, into 2 commands.

On `crosvm swap enable` command, the monitor process just moves the
guest memroy to the staging memory while blocking the whole crosvm
processes with SIGSTOP.

On `crosvm swap out` command, the monitor process writes the active
pages in the staging memory to the swap file.

The page faults between `swap enable` and `swap out` are swapped in from
the staging memory.

By waiting some time before sending swap out request after enabling
vmm-swap, hot pages on the guest memory, which are frequently accessed,
are swapped in from the staging memory and we can reduce the TBW of the
swap file and reduce the latency of page faults for hot pages.

BUG=b:263830401
TEST=cargo test -p swap -p base

Change-Id: Ia83f5052cc0bd4d25089c6a6680e40a1fa1661c0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4134149
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Shin Kawamura <kawasin@google.com>
2023-01-10 08:07:57 +00:00
..
src swap: split vmm-swap out command 2023-01-10 08:07:57 +00:00
tests swap: split vmm-swap out command 2023-01-10 08:07:57 +00:00
Cargo.toml swap: add helpers for pagesize 2023-01-10 03:10:00 +00:00