From patchwork Tue May 28 01:47:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 1106000 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.intel.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45CcFG6RCnz9s7h for ; Tue, 28 May 2019 11:48:34 +1000 (AEST) Received: from localhost ([127.0.0.1]:55595 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVRE8-00010s-PQ for incoming@patchwork.ozlabs.org; Mon, 27 May 2019 21:48:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVRDP-0000zO-9g for qemu-devel@nongnu.org; Mon, 27 May 2019 21:47:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVRDO-0003aL-Da for qemu-devel@nongnu.org; Mon, 27 May 2019 21:47:47 -0400 Received: from mga11.intel.com ([192.55.52.93]:31236) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVRDO-0003YP-6W for qemu-devel@nongnu.org; Mon, 27 May 2019 21:47:46 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 May 2019 18:47:45 -0700 X-ExtLoop1: 1 Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by orsmga006.jf.intel.com with ESMTP; 27 May 2019 18:47:44 -0700 From: Wei Yang To: qemu-devel@nongnu.org Date: Tue, 28 May 2019 09:47:00 +0800 Message-Id: <20190528014703.21030-2-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190528014703.21030-1-richardw.yang@linux.intel.com> References: <20190528014703.21030-1-richardw.yang@linux.intel.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.93 Subject: [Qemu-devel] [PATCH 1/4] migration: multifd_save_setup always return 0 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wei Yang , dgilbert@redhat.com, quintela@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Wei Yang --- migration/migration.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index d0a0f68f11..3aae4f2734 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -3336,12 +3336,7 @@ void migrate_fd_connect(MigrationState *s, Error *error_in) return; } - if (multifd_save_setup() != 0) { - migrate_set_state(&s->state, MIGRATION_STATUS_SETUP, - MIGRATION_STATUS_FAILED); - migrate_fd_cleanup(s); - return; - } + multifd_save_setup(); qemu_thread_create(&s->thread, "live_migration", migration_thread, s, QEMU_THREAD_JOINABLE); s->migration_thread_running = true; From patchwork Tue May 28 01:47:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 1106001 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.intel.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45CcFH11Z2z9s3Z for ; Tue, 28 May 2019 11:48:34 +1000 (AEST) Received: from localhost ([127.0.0.1]:55597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVRE9-00011P-02 for incoming@patchwork.ozlabs.org; Mon, 27 May 2019 21:48:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52470) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVRDR-000108-8L for qemu-devel@nongnu.org; Mon, 27 May 2019 21:47:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVRDQ-0003c8-GO for qemu-devel@nongnu.org; Mon, 27 May 2019 21:47:49 -0400 Received: from mga11.intel.com ([192.55.52.93]:31236) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVRDQ-0003YP-9X for qemu-devel@nongnu.org; Mon, 27 May 2019 21:47:48 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 May 2019 18:47:47 -0700 X-ExtLoop1: 1 Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by orsmga006.jf.intel.com with ESMTP; 27 May 2019 18:47:46 -0700 From: Wei Yang To: qemu-devel@nongnu.org Date: Tue, 28 May 2019 09:47:01 +0800 Message-Id: <20190528014703.21030-3-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190528014703.21030-1-richardw.yang@linux.intel.com> References: <20190528014703.21030-1-richardw.yang@linux.intel.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.93 Subject: [Qemu-devel] [PATCH 2/4] migration/ram.c: use same type in MultiFDPages_t to define offsest X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wei Yang , dgilbert@redhat.com, quintela@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" MultiFDPacket_t.offset is allocated to store MultiFDPages_t.offset. It would be better to use the same type. Signed-off-by: Wei Yang --- migration/ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/ram.c b/migration/ram.c index 4c60869226..dcf4c54eb5 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -607,7 +607,7 @@ typedef struct { uint64_t packet_num; uint64_t unused[4]; /* Reserved for future use */ char ramblock[256]; - uint64_t offset[]; + ram_addr_t offset[]; } __attribute__((packed)) MultiFDPacket_t; typedef struct { From patchwork Tue May 28 01:47:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 1106006 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.intel.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45CcHs1mn8z9s3Z for ; Tue, 28 May 2019 11:50:49 +1000 (AEST) Received: from localhost ([127.0.0.1]:55638 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVRGJ-0002jH-7Z for incoming@patchwork.ozlabs.org; Mon, 27 May 2019 21:50:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVRDU-00013N-Ut for qemu-devel@nongnu.org; Mon, 27 May 2019 21:47:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVRDU-0003f7-19 for qemu-devel@nongnu.org; Mon, 27 May 2019 21:47:52 -0400 Received: from mga11.intel.com ([192.55.52.93]:31236) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVRDT-0003YP-No for qemu-devel@nongnu.org; Mon, 27 May 2019 21:47:51 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 May 2019 18:47:51 -0700 X-ExtLoop1: 1 Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by orsmga006.jf.intel.com with ESMTP; 27 May 2019 18:47:49 -0700 From: Wei Yang To: qemu-devel@nongnu.org Date: Tue, 28 May 2019 09:47:02 +0800 Message-Id: <20190528014703.21030-4-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190528014703.21030-1-richardw.yang@linux.intel.com> References: <20190528014703.21030-1-richardw.yang@linux.intel.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.93 Subject: [Qemu-devel] [PATCH 3/4] migration/ram.c: MultiFDSendParams.sem_sync is not really used X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wei Yang , dgilbert@redhat.com, quintela@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Besides init and destroy, MultiFDSendParams.sem_sync is not really used. Signed-off-by: Wei Yang Reviewed-by: Juan Quintela --- migration/ram.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index dcf4c54eb5..5d31f7bd4c 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -661,8 +661,6 @@ typedef struct { uint64_t num_packets; /* pages sent through this channel */ uint64_t num_pages; - /* syncs main thread and channels */ - QemuSemaphore sem_sync; } MultiFDSendParams; typedef struct { @@ -1027,7 +1025,6 @@ void multifd_save_cleanup(void) p->c = NULL; qemu_mutex_destroy(&p->mutex); qemu_sem_destroy(&p->sem); - qemu_sem_destroy(&p->sem_sync); g_free(p->name); p->name = NULL; multifd_pages_clear(p->pages); @@ -1201,7 +1198,6 @@ int multifd_save_setup(void) qemu_mutex_init(&p->mutex); qemu_sem_init(&p->sem, 0); - qemu_sem_init(&p->sem_sync, 0); p->quit = false; p->pending_job = 0; p->id = i; From patchwork Tue May 28 01:47:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 1106007 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.intel.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45CcJ04WDTz9s3Z for ; Tue, 28 May 2019 11:50:56 +1000 (AEST) Received: from localhost ([127.0.0.1]:55647 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVRGQ-0002rA-Fk for incoming@patchwork.ozlabs.org; Mon, 27 May 2019 21:50:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVRDZ-00017E-6i for qemu-devel@nongnu.org; Mon, 27 May 2019 21:48:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVRDX-0003hm-5S for qemu-devel@nongnu.org; Mon, 27 May 2019 21:47:56 -0400 Received: from mga11.intel.com ([192.55.52.93]:31236) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVRDW-0003YP-RC for qemu-devel@nongnu.org; Mon, 27 May 2019 21:47:55 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 May 2019 18:47:53 -0700 X-ExtLoop1: 1 Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by orsmga006.jf.intel.com with ESMTP; 27 May 2019 18:47:52 -0700 From: Wei Yang To: qemu-devel@nongnu.org Date: Tue, 28 May 2019 09:47:03 +0800 Message-Id: <20190528014703.21030-5-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190528014703.21030-1-richardw.yang@linux.intel.com> References: <20190528014703.21030-1-richardw.yang@linux.intel.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.93 Subject: [Qemu-devel] [PATCH 4/4] migration/ram.c: multifd_send_state->count is not really used X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wei Yang , dgilbert@redhat.com, quintela@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Wei Yang Reviewed-by: Juan Quintela --- migration/ram.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 5d31f7bd4c..c9a9f7489b 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -892,8 +892,6 @@ static int multifd_recv_unfill_packet(MultiFDRecvParams *p, Error **errp) struct { MultiFDSendParams *params; - /* number of created threads */ - int count; /* array of pages to sent */ MultiFDPages_t *pages; /* syncs main thread and channels */ @@ -1171,8 +1169,6 @@ static void multifd_new_send_channel_async(QIOTask *task, gpointer opaque) p->running = true; qemu_thread_create(&p->thread, p->name, multifd_send_thread, p, QEMU_THREAD_JOINABLE); - - atomic_inc(&multifd_send_state->count); } } @@ -1188,7 +1184,6 @@ int multifd_save_setup(void) thread_count = migrate_multifd_channels(); multifd_send_state = g_malloc0(sizeof(*multifd_send_state)); multifd_send_state->params = g_new0(MultiFDSendParams, thread_count); - atomic_set(&multifd_send_state->count, 0); multifd_send_state->pages = multifd_pages_init(page_count); qemu_sem_init(&multifd_send_state->sem_sync, 0); qemu_sem_init(&multifd_send_state->channels_ready, 0);