migration/postcopy: enable compress during postcopy
commit644acf99b8cb8437f65600cf00c2e090bf3e3bc2
authorWei Yang <richardw.yang@linux.intel.com>
Thu, 7 Nov 2019 12:39:07 +0000 (7 20:39 +0800)
committerJuan Quintela <quintela@redhat.com>
Mon, 20 Jan 2020 08:10:23 +0000 (20 09:10 +0100)
tree40089c7c38dccffe4ef236a3f8567e8797ca5ec7
parent91ba442f5c26eaf45e2f78fc7e40fe6a7fdf7b9d
migration/postcopy: enable compress during postcopy

postcopy requires to place a whole host page, while migration thread
migrate memory in target page size. This makes postcopy need to collect
all target pages in one host page before placing via userfaultfd.

To enable compress during postcopy, there are two problems to solve:

    1. Random order for target page arrival
    2. Target pages in one host page arrives without interrupt by target
       page from other host page

The first one is handled by previous cleanup patch.

This patch handles the second one by:

    1. Flush compress thread for each host page
    2. Wait for decompress thread for before placing host page

Signed-off-by: Wei Yang <richardw.yang@linux.intel.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/migration.c
migration/ram.c