]> git.proxmox.com Git - mirror_qemu.git/commit
migration: Simplify unqueue_page()
authorPeter Xu <peterx@redhat.com>
Wed, 19 Jan 2022 08:09:19 +0000 (16:09 +0800)
committerJuan Quintela <quintela@redhat.com>
Fri, 28 Jan 2022 14:38:23 +0000 (15:38 +0100)
commitcfd66f30fb0f735df06ff4220e5000290a43dad3
tree1c60c70a0404aa963b75c2c73e8783b51d9ae54f
parenta1fe28df7547120bc3ac8bc4c3d1565d4cf7905e
migration: Simplify unqueue_page()

This patch simplifies unqueue_page() on both sides of it (itself, and caller).

Firstly, due to the fact that right after unqueue_page() returned true, we'll
definitely send a huge page (see ram_save_huge_page() call - it will _never_
exit before finish sending that huge page), so unqueue_page() does not need to
jump in small page size if huge page is enabled on the ramblock.  IOW, it's
destined that only the 1st 4K page will be valid, when unqueue the 2nd+ time
we'll notice the whole huge page has already been sent anyway.  Switching to
operating on huge page reduces a lot of the loops of redundant unqueue_page().

Meanwhile, drop the dirty check.  It's not helpful to call test_bit() every
time to jump over clean pages, as ram_save_host_page() has already done so,
while in a faster way (see commit ba1b7c812c ("migration/ram: Optimize
ram_save_host_page()", 2021-05-13)).  So that's not necessary too.

Drop the two tracepoints along the way - based on above analysis it's very
possible that no one is really using it..

Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
migration/ram.c
migration/trace-events