Commit 5089fcc
committed
fix(vmm): only use memfd if no vhost-user-blk devices configured
Page faults are more expensive for shared memory mapping (like memfd).
For this reason, we only back guest memory with a memfd
if a vhost-user-blk device is configured in the VM, otherwise
we fall back to anonymous private memory.
This is recovering performance demonstrated before commit
027a992 had been merged.
The vhost-user-blk branch in VM creation is not currently
covered by Rust integration tests, because we are looking for
a converging solution, so guest memory is always created
in the same way, and implementing required integration test
infrastructure code (spawing a backend process) would not
be useful long term.
(cherry picked from commit 931207b)
Signed-off-by: Nikita Kalyazin <[email protected]>1 parent 36184b4 commit 5089fcc
1 file changed
+33
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
246 | 273 | | |
247 | 274 | | |
248 | 275 | | |
| |||
0 commit comments