diff options
author | David Hildenbrand <david@redhat.com> | 2023-01-05 13:45:28 +0100 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2023-02-06 19:22:56 +0100 |
commit | e41c57702e940fcb9a8046edc3b43edda5134305 (patch) | |
tree | fbe08e303d24e4a6ea9e5da0c1e4a769d0a60001 /gdbstub | |
parent | 59bcc049c17a50d8ac0353f164f597e7d904589d (diff) | |
download | qemu-e41c57702e940fcb9a8046edc3b43edda5134305.zip qemu-e41c57702e940fcb9a8046edc3b43edda5134305.tar.gz qemu-e41c57702e940fcb9a8046edc3b43edda5134305.tar.bz2 |
migration/ram: Optimize ram_write_tracking_start() for RamDiscardManager
ram_block_populate_read() already optimizes for RamDiscardManager.
However, ram_write_tracking_start() will still try protecting discarded
memory ranges.
Let's optimize, because discarded ranges don't map any pages and
(1) For anonymous memory, trying to protect using uffd-wp without a mapped
page is ignored by the kernel and consequently a NOP.
(2) For shared/file-backed memory, we will fill present page tables in the
range with PTE markers. However, we will even allocate page tables
just to fill them with unnecessary PTE markers and effectively
waste memory.
So let's exclude these ranges, just like ram_block_populate_read()
already does.
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'gdbstub')
0 files changed, 0 insertions, 0 deletions