mirror of https://github.com/xemu-project/xemu.git
migration/multifd: Move pages accounting into multifd_send_zero_page_detect()
All references to pages are being removed from the multifd worker threads in order to allow multifd to deal with different payload types. multifd_send_zero_page_detect() is called by all multifd migration paths that deal with pages and is the last spot where zero pages and normal page amounts are adjusted. Move the pages accounting into that function. Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Fabiano Rosas <farosas@suse.de>
This commit is contained in:
parent
9f0e108901
commit
5aff71767c
|
@ -14,6 +14,7 @@
|
||||||
#include "qemu/cutils.h"
|
#include "qemu/cutils.h"
|
||||||
#include "exec/ramblock.h"
|
#include "exec/ramblock.h"
|
||||||
#include "migration.h"
|
#include "migration.h"
|
||||||
|
#include "migration-stats.h"
|
||||||
#include "multifd.h"
|
#include "multifd.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
#include "ram.h"
|
#include "ram.h"
|
||||||
|
@ -53,7 +54,7 @@ void multifd_send_zero_page_detect(MultiFDSendParams *p)
|
||||||
|
|
||||||
if (!multifd_zero_page_enabled()) {
|
if (!multifd_zero_page_enabled()) {
|
||||||
pages->normal_num = pages->num;
|
pages->normal_num = pages->num;
|
||||||
return;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -74,6 +75,10 @@ void multifd_send_zero_page_detect(MultiFDSendParams *p)
|
||||||
}
|
}
|
||||||
|
|
||||||
pages->normal_num = i;
|
pages->normal_num = i;
|
||||||
|
|
||||||
|
out:
|
||||||
|
stat64_add(&mig_stats.normal_pages, pages->normal_num);
|
||||||
|
stat64_add(&mig_stats.zero_pages, pages->num - pages->normal_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
void multifd_recv_zero_page_process(MultiFDRecvParams *p)
|
void multifd_recv_zero_page_process(MultiFDRecvParams *p)
|
||||||
|
|
|
@ -989,8 +989,6 @@ static void *multifd_send_thread(void *opaque)
|
||||||
|
|
||||||
stat64_add(&mig_stats.multifd_bytes,
|
stat64_add(&mig_stats.multifd_bytes,
|
||||||
p->next_packet_size + p->packet_len);
|
p->next_packet_size + p->packet_len);
|
||||||
stat64_add(&mig_stats.normal_pages, pages->normal_num);
|
|
||||||
stat64_add(&mig_stats.zero_pages, pages->num - pages->normal_num);
|
|
||||||
|
|
||||||
multifd_pages_reset(pages);
|
multifd_pages_reset(pages);
|
||||||
p->next_packet_size = 0;
|
p->next_packet_size = 0;
|
||||||
|
|
Loading…
Reference in New Issue