migration/ram: Factor out populating pages readable in ram_block_populate_pages()
commitf7b9dcfbcf44aa38d132038e9b675ea7e714a570
authorDavid Hildenbrand <david@redhat.com>
Mon, 11 Oct 2021 17:53:45 +0000 (11 19:53 +0200)
committerJuan Quintela <quintela@redhat.com>
Mon, 1 Nov 2021 21:56:44 +0000 (1 22:56 +0100)
tree054ad70c834dcbbe0eba870f434849073ad3c17d
parent7648297d40649bbffb296b2d8f2f388f19868759
migration/ram: Factor out populating pages readable in ram_block_populate_pages()

Let's factor out prefaulting/populating to make further changes easier to
review and add a comment what we are actually expecting to happen. While at
it, use the actual page size of the ramblock, which defaults to
qemu_real_host_page_size for anonymous memory. Further, rename
ram_block_populate_pages() to ram_block_populate_read() as well, to make
it clearer what we are doing.

In the future, we might want to use MADV_POPULATE_READ to speed up
population.

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
migration/ram.c