[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/38] multifd: recv side only needs the RAMBlock host address
From: |
Juan Quintela |
Subject: |
[PULL 16/38] multifd: recv side only needs the RAMBlock host address |
Date: |
Thu, 27 Jan 2022 16:05:26 +0100 |
So we can remove the MultiFDPages.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
migration/multifd.h | 4 ++--
migration/multifd-zlib.c | 2 +-
migration/multifd-zstd.c | 2 +-
migration/multifd.c | 7 ++-----
4 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/migration/multifd.h b/migration/multifd.h
index 850889c5d8..be460f821b 100644
--- a/migration/multifd.h
+++ b/migration/multifd.h
@@ -136,8 +136,8 @@ typedef struct {
bool running;
/* should this thread finish */
bool quit;
- /* array of pages to receive */
- MultiFDPages_t *pages;
+ /* ramblock host address */
+ uint8_t *host;
/* packet allocated len */
uint32_t packet_len;
/* pointer to the packet */
diff --git a/migration/multifd-zlib.c b/migration/multifd-zlib.c
index 8239c840d3..aba1c88a0c 100644
--- a/migration/multifd-zlib.c
+++ b/migration/multifd-zlib.c
@@ -253,7 +253,7 @@ static int zlib_recv_pages(MultiFDRecvParams *p, Error
**errp)
}
zs->avail_out = page_size;
- zs->next_out = p->pages->block->host + p->normal[i];
+ zs->next_out = p->host + p->normal[i];
/*
* Welcome to inflate semantics
diff --git a/migration/multifd-zstd.c b/migration/multifd-zstd.c
index c5ed72ddcd..d788d309f2 100644
--- a/migration/multifd-zstd.c
+++ b/migration/multifd-zstd.c
@@ -264,7 +264,7 @@ static int zstd_recv_pages(MultiFDRecvParams *p, Error
**errp)
z->in.pos = 0;
for (i = 0; i < p->normal_num; i++) {
- z->out.dst = p->pages->block->host + p->normal[i];
+ z->out.dst = p->host + p->normal[i];
z->out.size = page_size;
z->out.pos = 0;
diff --git a/migration/multifd.c b/migration/multifd.c
index e362b1bb89..b39fef5dfe 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -147,7 +147,7 @@ static int nocomp_recv_pages(MultiFDRecvParams *p, Error
**errp)
return -1;
}
for (int i = 0; i < p->normal_num; i++) {
- p->iov[i].iov_base = p->pages->block->host + p->normal[i];
+ p->iov[i].iov_base = p->host + p->normal[i];
p->iov[i].iov_len = page_size;
}
return qio_channel_readv_all(p->c, p->iov, p->normal_num, errp);
@@ -340,7 +340,7 @@ static int multifd_recv_unfill_packet(MultiFDRecvParams *p,
Error **errp)
return -1;
}
- p->pages->block = block;
+ p->host = block->host;
for (i = 0; i < p->normal_num; i++) {
uint64_t offset = be64_to_cpu(packet->offset[i]);
@@ -1007,8 +1007,6 @@ int multifd_load_cleanup(Error **errp)
qemu_sem_destroy(&p->sem_sync);
g_free(p->name);
p->name = NULL;
- multifd_pages_clear(p->pages);
- p->pages = NULL;
p->packet_len = 0;
g_free(p->packet);
p->packet = NULL;
@@ -1149,7 +1147,6 @@ int multifd_load_setup(Error **errp)
qemu_sem_init(&p->sem_sync, 0);
p->quit = false;
p->id = i;
- p->pages = multifd_pages_init(page_count);
p->packet_len = sizeof(MultiFDPacket_t)
+ sizeof(uint64_t) * page_count;
p->packet = g_malloc0(p->packet_len);
--
2.34.1
- [PULL 06/38] migration: Move ram_release_pages() call to save_zero_page_to_file(), (continued)
- [PULL 06/38] migration: Move ram_release_pages() call to save_zero_page_to_file(), Juan Quintela, 2022/01/27
- [PULL 07/38] multifd: Use proper maximum compression values, Juan Quintela, 2022/01/27
- [PULL 08/38] multifd: Move iov from pages to params, Juan Quintela, 2022/01/27
- [PULL 09/38] multifd: Make zlib use iov's, Juan Quintela, 2022/01/27
- [PULL 11/38] multifd: Remove send_write() method, Juan Quintela, 2022/01/27
- [PULL 10/38] multifd: Make zstd use iov's, Juan Quintela, 2022/01/27
- [PULL 12/38] multifd: Use a single writev on the send side, Juan Quintela, 2022/01/27
- [PULL 13/38] multifd: Unfold "used" variable by its value, Juan Quintela, 2022/01/27
- [PULL 14/38] multifd: Use normal pages array on the send side, Juan Quintela, 2022/01/27
- [PULL 15/38] multifd: Use normal pages array on the recv side, Juan Quintela, 2022/01/27
- [PULL 16/38] multifd: recv side only needs the RAMBlock host address,
Juan Quintela <=
- [PULL 17/38] multifd: Rename pages_used to normal_pages, Juan Quintela, 2022/01/27
- [PULL 18/38] Remove unnecessary minimum_version_id_old fields, Juan Quintela, 2022/01/27
- [PULL 19/38] migration/migration.c: Add missed default error handler for migration state, Juan Quintela, 2022/01/27
- [PULL 20/38] migration/migration.c: Avoid COLO boot in postcopy migration, Juan Quintela, 2022/01/27
- [PULL 21/38] migration/migration.c: Remove the MIGRATION_STATUS_ACTIVE when migration finished, Juan Quintela, 2022/01/27
- [PULL 22/38] migration: Report the error returned when save_live_iterate fails, Juan Quintela, 2022/01/27
- [PULL 24/38] migration: Perform vmsd structure check during tests, Juan Quintela, 2022/01/27
- [PULL 23/38] migration: Add canary to VMSTATE_END_OF_LIST, Juan Quintela, 2022/01/27
- [PULL 25/38] migration/ram: clean up unused comment., Juan Quintela, 2022/01/27
- [PULL 28/38] migration: Drop postcopy_chunk_hostpages(), Juan Quintela, 2022/01/27