Skip to content

Commit 094ef25

Browse files
committed
Address clanker feedback
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
1 parent 9116d7c commit 094ef25

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

  • proposals/0003-incremental-snapshots

proposals/0003-incremental-snapshots/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,16 @@ the host restores the base snapshot, adds the state of that customer, for
2828
example a WebAssembly module, and then runs the code of the customer.
2929

3030
Caching a snapshot for the top N customers would remove that work from most
31-
requests. Unfortunately the memory cost currently makes this impractical as every snapshot stores a full
32-
copy of the sandbox memory, so N cached customers means N copies of the
33-
WebAssembly runtime, while the customer state is a small fraction of each one.
31+
requests. The memory cost makes this impractical today, because every snapshot
32+
stores a full copy of the sandbox memory. N cached customers means N copies of
33+
the WebAssembly runtime, while the customer state is a small fraction of each
34+
one.
3435

3536
With incremental snapshots, a customer snapshot holds only the pages that the
3637
state of the customer changed. All N snapshots share the blob of the base
3738
snapshot. Thus the cache costs the size of the base snapshot and the sum of the
3839
changes, and the host can keep many more customers in memory.
3940

40-
41-
4241
## Proposal
4342

4443
### Data model
@@ -87,8 +86,9 @@ that they use.
8786
### Taking a Snapshot of a Sandbox
8887

8988
1. Find the pages that this snapshot must save. Read the guest page tables to
90-
get all the mapped pages. If the guest physical address of a page is in a
91-
live range of a layer, this snapshot shares that page with a previous snapshot, and does not need to save it. All other pages must be saved.
89+
get all the mapped pages. A page whose guest physical address is in a live
90+
range of a layer is already in a previous snapshot, and this snapshot shares
91+
it. All other pages must be saved.
9292
2. Find a place in the guest address space for the new pages. The new blob must
9393
not overlap the layers that this snapshot keeps. Use the first unused part
9494
that is large enough.
@@ -118,8 +118,8 @@ page tables of the snapshot into scratch, and resets the vCPU.
118118
A snapshot has one VM memory mapping for each live range of each of its layers.
119119
Mapping or unmapping one is a hypervisor call. A restore changes only the
120120
mappings that differ, but that can be all of them, so an unbounded number of
121-
live ranges would make a restore arbitrarily slow. A snapshot therefore has an
122-
arbitrary cap on its total mappings, and taking a snapshot above the cap fails.
121+
live ranges would make a restore arbitrarily slow. A snapshot therefore has a
122+
fixed cap on its total mappings, and taking a snapshot above the cap fails.
123123
Every layer except the one with the restore page tables must give at least one
124124
live range, so the cap bounds the layer count too.
125125

0 commit comments

Comments
 (0)