migration/multifd: Postpone reset of MultiFDPages_t
authorPeter Xu <peterx@redhat.com>
Fri, 2 Feb 2024 10:28:38 +0000 (18:28 +0800)
committerPeter Xu <peterx@redhat.com>
Mon, 5 Feb 2024 06:42:10 +0000 (14:42 +0800)
commit836eca47f62f9f6d5b8e9b6fedfc3539775c4e2e
tree6ed29ec2518c52d43950696fed172e2eb716fc56
parent15f3f21d598148895c33b6fc41e29777cf6ad992
migration/multifd: Postpone reset of MultiFDPages_t

Now we reset MultiFDPages_t object in the multifd sender thread in the
middle of the sending job.  That's not necessary, because the "*pages"
struct will not be reused anyway until pending_job is cleared.

Move that to the end after the job is completed, provide a helper to reset
a "*pages" object.  Use that same helper when free the object too.

This prepares us to keep using p->pages in the follow up patches, where we
may drop p->normal[].

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/20240202102857.110210-5-peterx@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
migration/multifd.c