firecracker icon indicating copy to clipboard operation
firecracker copied to clipboard

Page fault about firecracker

Open thunderZH963 opened this issue 3 years ago • 1 comments

As firecracker said, it is implemented based on KVM. Then, the processing of page fault should be consistent with KVM / QEMU. But in my test, the delay of page fault in microVM is lower than QEMU / KVM VM. Why?

Hope to get a reply and discussion.

Thanks.

thunderZH963 avatar Mar 24 '22 09:03 thunderZH963

I can observe "let memory_region = kvm_userspace_memory_region{...}" in firecracker/src/vm.rs

or maybe other codes indicate "page fault handler"?

thunderZH963 avatar Mar 24 '22 09:03 thunderZH963

But in my test, the delay of page fault in microVM is lower than QEMU / KVM VM. Why?

If you can provide the failing test case we would be interested to take a look.

JonathanWoollett-Light avatar Apr 11 '23 08:04 JonathanWoollett-Light

But in my test, the delay of page fault in microVM is lower than QEMU / KVM VM. Why?

If you can provide the failing test case we would be interested to take a look.

The cases shown in below and the results also are shown.

lat/us micro fork+exit micro fork+execve micro fork+shell micro pipe micro mmap-write micro mmap-read lmbench fork+exit lmbench fork+execve lmbench fork+shell lmbench pipe lmbench mmap-write lmbench mmap-read lmbench pagefault
Baremetal 93.335 315.87 812.01 1.52 43.177 16.812 98.1964 328.875 807.7143 5.0492 15.823 6.42 0.25
KVM 108.284 540.135 1825.631 1.629 47.932 32.9 113.08 465.1818 1770.3333 5.66 17.022 10.1 1.18
Firecracker 99.57 517.164 1033.429 1.576 43.207 17.36 100.5926 355.625 842.3846 5.1561 17.021 9.56 0.31

thunderZH963 avatar Apr 12 '23 06:04 thunderZH963

Hi @thunderZH963, We do not maintain comparisons with QEMU/other virtualization technologies, so we do not know why you observe these performance differences. Firecracker is more lightweight than QEMU, so I would expect this difference in complexity to play a role. I'm converting this issue to a discussion in case other community members would like to chime in on this :)

roypat avatar Oct 09 '23 10:10 roypat