You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the balloon inflates, and the guest gives us back some pages of
memory, we need to free those pages. In booted VMs, we do this with
madvise(MADV_DONTNEED), and in restored VMs we do it by MAP_FIXED-ing a
new VMA on top of the range-to-free. This is because if guest memory is
a MAP_PRIVATE of a memory file, madvise has no effect.
However, we also do this MAP_FIXED trick if the snapshot is restored
with UFFD. In this case, its not needed (madvise works perfectly fine),
and in fact, its wrong: If we map over the memory range, UFFD will not
receive Remove events for the specified range.
Fix this by only using the mmap trick for file-based restored.
Fixes#4988
Signed-off-by: Patrick Roy <[email protected]>
0 commit comments