Received: from eggs.gnu.org ([2001:4830:134:3::10]:41753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ds5Ok-0005op-5W for qemu-devel@nongnu.org; Wed, 13 Sep 2017 07:00:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ds5Oh-0005zE-1Z for qemu-devel@nongnu.org; Wed, 13 Sep 2017 07:00:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37104) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ds5Og-0005yX-Ow for qemu-devel@nongnu.org; Wed, 13 Sep 2017 06:59:58 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A2A425D68A for ; Wed, 13 Sep 2017 10:59:57 +0000 (UTC) From: Juan Quintela Date: Wed, 13 Sep 2017 12:59:33 +0200 Message-Id: <20170913105953.13760-1-quintela@redhat.com> Subject: [Qemu-devel] [PATCH v8 00/20] Multifd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: dgilbert@redhat.com, lvivier@redhat.com, peterx@redhat.com Hi Things NOT done yet: - drop x-multifd-page-count? We can use performance to set a default value - paolo suggestion of not having a control channel needs iyet more cleanups to be able to have more than one ramstate, trying it. - still not performance done, but it has been very stable On v8: - use connect_async - rename multifd-group to multifd-page-count (danp suggestion) - rename multifd-threads to multifd-channels (danp suggestion) - use new qio*channel functions - Address rest of comments left So, please review. My idea will be to pull this changes and continue performance changes for inside, basically everything is already reviewed. Thanks, Juan. On v7: - tests fixed as danp wanted - have to revert danp qio_*_all patches, as they break multifd, I have to investigate why. - error_abort is gone. After several tries about getting errors, I ended having a single error proceted by a lock and first error wins. - Addressed basically all reviews (see on ToDo) - Pointers to struct are done now - fix lots of leaks - lots of small fixes [v6] - Improve migration_ioc_porcess_incoming - teach about G_SOURCE_REMOVE/CONTINUE - Add test for migration_has_all_channels - use DEFIN_PROP* - change recv_state to use pointers to parameters make easier to receive channels out of order - use g_strdup_printf() - improve count of threads to know when we have to finish - report channel id's on errors - Use last_page parameter for multifd_send_page() sooner - Improve commets for address - use g_new0() instead of g_malloc() - create MULTIFD_CONTINUE instead of using UINT16_MAX - clear memory used by group of pages once there, pass everything to the global state variables instead of being local to the function. This way it works if we cancel migration and start a new one - Really wait to create the migration_thread until all channels are created - split initial_bytes setup to make clearer following patches. - createRAM_SAVE_FLAG_MULTIFD_SYNC macro, to make clear what we are doing - move setting of need_flush to inside bitmap_sync - Lots of other small changes & reorderings Please, comment. [v5] - tests from qio functions (a.k.a. make danp happy) - 1st message from one channel to the other contains: multifd This would allow us to create more channels as we want them. a.k.a. Making dave happy - Waiting in reception for new channels using qio listeners Getting threads, qio and reference counters working at the same time was interesing. Another make danp happy. - Lots and lots of small changes and fixes. Notice that the last 70 patches that I merged or so what to make this series easier/smaller. - NOT DONE: I haven't been woring on measuring performance differences, this was about getting the creation of the threads/channels right. So, what I want: - Are people happy with how I have (ab)used qio channels? (yes danp, that is you). - My understanding is th ToDo: - Make paolo happy: He wanted to test using control information through each channel, not only pages. This requires yet more cleanups to be able to have more than one QEMUFile/RAMState open at the same time. - How I create multiple channels. Things I know: * with current changes, it should work with fd/channels (the multifd bits), but we don;t have a way to pass multiple fd;s or exec files. Danp, any idea about how to create an UI for it? * My idea is that we would split current code to be: + channel creation at migration.c + rest of bits at ram.c + change format to: main so we can check postcopy Dave wanted a way to create a new fd for postcopy for some time + Adding new channels is easy - Performance data/numbers: Yes, I wanted to get this out at once, I would continue with this. Please, review. [v4] This is the 4th version of multifd. Changes: - XBZRLE don't need to be checked for - Documentation and defaults are consistent - split socketArgs - use iovec instead of creating something similar. - We use now the exported size of target page (another HACK removal) - created qio_chanel_{wirtev,readv}_all functions. the _full() name was already taken. What they do is the same that the without _all() function, but if it returns due to blocking it redo the call. - it is checkpatch.pl clean now. Please comment, Juan. Juan Quintela (20): migration: Create migration_ioc_process_incoming() migration: Teach it about G_SOURCE_REMOVE migration: Add comments to channel functions migration: Create migration_has_all_channels migration: Improve migration thread error handling migration: Make migrate_fd_error() the owner of the Error migration: Add multifd capability migration: Create x-multifd-channels parameter migration: Create x-multifd-page-count parameter migration: Create multifd migration threads migration: Split migration_fd_process_incoming migration: Start of multiple fd work migration: Create ram_multifd_page migration: Really use multiple pages at a time migration: Send the fd number which we are going to use for this page migration: Create thread infrastructure for multifd recv side migration: Test new fd infrastructure migration: Rename initial_bytes migration: Transfer pages over new channels migration: Flush receive queue hmp.c | 16 ++ include/glib-compat.h | 2 + migration/channel.c | 19 +- migration/exec.c | 2 +- migration/fd.c | 2 +- migration/migration.c | 176 ++++++++++++++-- migration/migration.h | 17 +- migration/ram.c | 574 +++++++++++++++++++++++++++++++++++++++++++++++++- migration/ram.h | 8 + migration/socket.c | 47 ++++- migration/socket.h | 10 + migration/tls.c | 1 - qapi/migration.json | 44 +++- 13 files changed, 883 insertions(+), 35 deletions(-) -- 2.13.5