From nobody Tue Apr 23 19:48:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1560336909; cv=none; d=zoho.com; s=zohoarc; b=gZ9W6W0kvEBd5alDUyFzNfWHzvB57GNAEg2z+qBIDvFLH/VxqK0sbQuYvjeZ45npnYgMH6URFrU9V7/7+zBGJZGQRmjEl0bPUcdDJOis94BY0M1skFavPLLxENdA1keyxhY9HwesQZBwaJjSgApZ+UL825WXuNQ4Bk+jDRV48sU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560336909; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=prbEDDvw1JCzUjFOHZL7GqKAPivJzRTFOuPaU+GrIiI=; b=I7SL8elWP0G5olprpEbkkx7WfKncu5q7YKlJItX9jz7JqLRGECL0ZOdYAY0kGfvjc5h35PUNAgmvaNDFVcs2ElsNWcQEE/ZCF9ESXyWym5WIAxWWdAcwt1eLcgNcAxHRnQrkn2LEiY9mYoOY1CJ1/RRF1IAoBWYY7XMRewTWANs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560336909548685.3110378718036; Wed, 12 Jun 2019 03:55:09 -0700 (PDT) Received: from localhost ([::1]:58740 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hb0uF-0000rT-Fx for importer@patchew.org; Wed, 12 Jun 2019 06:55:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58702) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hb0o0-0003I5-78 for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hb0ny-0002pL-9H for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45344) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hb0nx-0002jX-W2 for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:34 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C6CBAC05B1CD; Wed, 12 Jun 2019 10:48:17 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-241.ams2.redhat.com [10.36.116.241]) by smtp.corp.redhat.com (Postfix) with ESMTP id 53F6127C39; Wed, 12 Jun 2019 10:48:14 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 12 Jun 2019 12:48:01 +0200 Message-Id: <20190612104808.6398-2-quintela@redhat.com> In-Reply-To: <20190612104808.6398-1-quintela@redhat.com> References: <20190612104808.6398-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 12 Jun 2019 10:48:20 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/8] migration: fix multifd_recv event typo X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , zhanghailiang , Juan Quintela , Markus Armbruster , "Dr. David Alan Gilbert" , Wei Yang , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" It uses num in multifd_send(). Make it coherent. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Wei Yang Signed-off-by: Juan Quintela --- migration/trace-events | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/trace-events b/migration/trace-events index de2e136e57..cd50a1e659 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -80,7 +80,7 @@ get_queued_page_not_dirty(const char *block_name, uint64_= t tmp_offset, unsigned migration_bitmap_sync_start(void) "" migration_bitmap_sync_end(uint64_t dirty_pages) "dirty_pages %" PRIu64 migration_throttle(void) "" -multifd_recv(uint8_t id, uint64_t packet_num, uint32_t used, uint32_t flag= s, uint32_t next_packet_size) "channel %d packet number %" PRIu64 " pages %= d flags 0x%x next packet size %d" +multifd_recv(uint8_t id, uint64_t packet_num, uint32_t used, uint32_t flag= s, uint32_t next_packet_size) "channel %d packet_num %" PRIu64 " pages %d f= lags 0x%x next packet size %d" multifd_recv_sync_main(long packet_num) "packet num %ld" multifd_recv_sync_main_signal(uint8_t id) "channel %d" multifd_recv_sync_main_wait(uint8_t id) "channel %d" --=20 2.21.0 From nobody Tue Apr 23 19:48:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1560336709; cv=none; d=zoho.com; s=zohoarc; b=cHQtjFvcOYeacZBMjalOlhdX6IBkUqagR/XaPZfnPNTq82tqEXxKx2tBuUOSndSYWOR0Q9CitgyDv0vzxv9nJkvuwt47LwaLq9QiwH9mlWXuACUa4BvjBbksezpnVfRfTsu1BP4GMG3asxc3UF3WsCTQoNmvft3mLeg6sxJOa0Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560336709; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ybu08jKEB7FZZDEynYJYyNCcqbvzYuml1dEsKBGDBvw=; b=Z2ulnhuWH1r9wrB8gep4oXwzfT0dB5tEK1rT49k+Ryro+bMBwKfvekamUSVUQ7LLtoGSfnPAae8E3DlPC8Wmqb6IfiZpLkMHd6mqRnGZrmIZyA8vU6tUSjAPdEwmn5FsP3GDaWiNpNh+WrJR2D0TgjqFPLyhO1k8hcmT6OtKdBU= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560336709853457.80952092905477; Wed, 12 Jun 2019 03:51:49 -0700 (PDT) Received: from localhost ([::1]:58708 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hb0r1-0005K3-Rb for importer@patchew.org; Wed, 12 Jun 2019 06:51:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58712) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hb0o0-0003IZ-Mu for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hb0ny-0002p0-13 for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37910) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hb0nx-0002nX-MZ for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:33 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 763DA550CF; Wed, 12 Jun 2019 10:48:23 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-241.ams2.redhat.com [10.36.116.241]) by smtp.corp.redhat.com (Postfix) with ESMTP id 278B828DF0; Wed, 12 Jun 2019 10:48:17 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 12 Jun 2019 12:48:02 +0200 Message-Id: <20190612104808.6398-3-quintela@redhat.com> In-Reply-To: <20190612104808.6398-1-quintela@redhat.com> References: <20190612104808.6398-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 12 Jun 2019 10:48:28 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/8] migration-test: rename parameter to parameter_int X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , zhanghailiang , Juan Quintela , Markus Armbruster , "Dr. David Alan Gilbert" , Wei Yang , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We would need _str ones on the next patch. Signed-off-by: Juan Quintela Reviewed-by: Wei Yang Signed-off-by: Juan Quintela --- tests/migration-test.c | 55 +++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index e0407576cb..ebabca8820 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -407,7 +407,8 @@ static char *migrate_get_socket_address(QTestState *who= , const char *parameter) return result; } =20 -static long long migrate_get_parameter(QTestState *who, const char *parame= ter) +static long long migrate_get_parameter_int(QTestState *who, + const char *parameter) { QDict *rsp; long long result; @@ -418,17 +419,17 @@ static long long migrate_get_parameter(QTestState *wh= o, const char *parameter) return result; } =20 -static void migrate_check_parameter(QTestState *who, const char *parameter, - long long value) +static void migrate_check_parameter_int(QTestState *who, const char *param= eter, + long long value) { long long result; =20 - result =3D migrate_get_parameter(who, parameter); + result =3D migrate_get_parameter_int(who, parameter); g_assert_cmpint(result, =3D=3D, value); } =20 -static void migrate_set_parameter(QTestState *who, const char *parameter, - long long value) +static void migrate_set_parameter_int(QTestState *who, const char *paramet= er, + long long value) { QDict *rsp; =20 @@ -438,7 +439,7 @@ static void migrate_set_parameter(QTestState *who, cons= t char *parameter, parameter, value); g_assert(qdict_haskey(rsp, "return")); qobject_unref(rsp); - migrate_check_parameter(who, parameter, value); + migrate_check_parameter_int(who, parameter, value); } =20 static void migrate_pause(QTestState *who) @@ -688,7 +689,7 @@ static void deprecated_set_downtime(QTestState *who, co= nst double value) " 'arguments': { 'value': %f } }", value); g_assert(qdict_haskey(rsp, "return")); qobject_unref(rsp); - migrate_check_parameter(who, "downtime-limit", value * 1000); + migrate_check_parameter_int(who, "downtime-limit", value * 1000); } =20 static void deprecated_set_speed(QTestState *who, long long value) @@ -699,7 +700,7 @@ static void deprecated_set_speed(QTestState *who, long = long value) "'arguments': { 'value': %lld } }", value); g_assert(qdict_haskey(rsp, "return")); qobject_unref(rsp); - migrate_check_parameter(who, "max-bandwidth", value); + migrate_check_parameter_int(who, "max-bandwidth", value); } =20 static void deprecated_set_cache_size(QTestState *who, long long value) @@ -710,7 +711,7 @@ static void deprecated_set_cache_size(QTestState *who, = long long value) "'arguments': { 'value': %lld } }", value); g_assert(qdict_haskey(rsp, "return")); qobject_unref(rsp); - migrate_check_parameter(who, "xbzrle-cache-size", value); + migrate_check_parameter_int(who, "xbzrle-cache-size", value); } =20 static void test_deprecated(void) @@ -745,8 +746,8 @@ static int migrate_postcopy_prepare(QTestState **from_p= tr, * quickly, but that it doesn't complete precopy even on a slow * machine, so also set the downtime. */ - migrate_set_parameter(from, "max-bandwidth", 100000000); - migrate_set_parameter(from, "downtime-limit", 1); + migrate_set_parameter_int(from, "max-bandwidth", 100000000); + migrate_set_parameter_int(from, "downtime-limit", 1); =20 /* Wait for the first serial output from the source */ wait_for_serial("src_serial"); @@ -797,7 +798,7 @@ static void test_postcopy_recovery(void) } =20 /* Turn postcopy speed down, 4K/s is slow enough on any machines */ - migrate_set_parameter(from, "max-postcopy-bandwidth", 4096); + migrate_set_parameter_int(from, "max-postcopy-bandwidth", 4096); =20 /* Now we start the postcopy */ migrate_postcopy_start(from, to); @@ -838,7 +839,7 @@ static void test_postcopy_recovery(void) g_free(uri); =20 /* Restore the postcopy bandwidth to unlimited */ - migrate_set_parameter(from, "max-postcopy-bandwidth", 0); + migrate_set_parameter_int(from, "max-postcopy-bandwidth", 0); =20 migrate_postcopy_complete(from, to); } @@ -884,9 +885,9 @@ static void test_precopy_unix(void) * machine, so also set the downtime. */ /* 1 ms should make it not converge*/ - migrate_set_parameter(from, "downtime-limit", 1); + migrate_set_parameter_int(from, "downtime-limit", 1); /* 1GB/s */ - migrate_set_parameter(from, "max-bandwidth", 1000000000); + migrate_set_parameter_int(from, "max-bandwidth", 1000000000); =20 /* Wait for the first serial output from the source */ wait_for_serial("src_serial"); @@ -896,7 +897,7 @@ static void test_precopy_unix(void) wait_for_migration_pass(from); =20 /* 300 ms should converge */ - migrate_set_parameter(from, "downtime-limit", 300); + migrate_set_parameter_int(from, "downtime-limit", 300); =20 if (!got_stop) { qtest_qmp_eventwait(from, "STOP"); @@ -963,11 +964,11 @@ static void test_xbzrle(const char *uri) * machine, so also set the downtime. */ /* 1 ms should make it not converge*/ - migrate_set_parameter(from, "downtime-limit", 1); + migrate_set_parameter_int(from, "downtime-limit", 1); /* 1GB/s */ - migrate_set_parameter(from, "max-bandwidth", 1000000000); + migrate_set_parameter_int(from, "max-bandwidth", 1000000000); =20 - migrate_set_parameter(from, "xbzrle-cache-size", 33554432); + migrate_set_parameter_int(from, "xbzrle-cache-size", 33554432); =20 migrate_set_capability(from, "xbzrle", "true"); migrate_set_capability(to, "xbzrle", "true"); @@ -979,7 +980,7 @@ static void test_xbzrle(const char *uri) wait_for_migration_pass(from); =20 /* 300ms should converge */ - migrate_set_parameter(from, "downtime-limit", 300); + migrate_set_parameter_int(from, "downtime-limit", 300); =20 if (!got_stop) { qtest_qmp_eventwait(from, "STOP"); @@ -1015,9 +1016,9 @@ static void test_precopy_tcp(void) * machine, so also set the downtime. */ /* 1 ms should make it not converge*/ - migrate_set_parameter(from, "downtime-limit", 1); + migrate_set_parameter_int(from, "downtime-limit", 1); /* 1GB/s */ - migrate_set_parameter(from, "max-bandwidth", 1000000000); + migrate_set_parameter_int(from, "max-bandwidth", 1000000000); =20 /* Wait for the first serial output from the source */ wait_for_serial("src_serial"); @@ -1029,7 +1030,7 @@ static void test_precopy_tcp(void) wait_for_migration_pass(from); =20 /* 300ms should converge */ - migrate_set_parameter(from, "downtime-limit", 300); + migrate_set_parameter_int(from, "downtime-limit", 300); =20 if (!got_stop) { qtest_qmp_eventwait(from, "STOP"); @@ -1061,9 +1062,9 @@ static void test_migrate_fd_proto(void) * machine, so also set the downtime. */ /* 1 ms should make it not converge */ - migrate_set_parameter(from, "downtime-limit", 1); + migrate_set_parameter_int(from, "downtime-limit", 1); /* 1GB/s */ - migrate_set_parameter(from, "max-bandwidth", 1000000000); + migrate_set_parameter_int(from, "max-bandwidth", 1000000000); =20 /* Wait for the first serial output from the source */ wait_for_serial("src_serial"); @@ -1097,7 +1098,7 @@ static void test_migrate_fd_proto(void) wait_for_migration_pass(from); =20 /* 300ms should converge */ - migrate_set_parameter(from, "downtime-limit", 300); + migrate_set_parameter_int(from, "downtime-limit", 300); =20 if (!got_stop) { qtest_qmp_eventwait(from, "STOP"); --=20 2.21.0 From nobody Tue Apr 23 19:48:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1560337221; cv=none; d=zoho.com; s=zohoarc; b=lbUXlPkT6kMA8we8jAj98Zbzq0U9Rrvwx9aUYry7XeWVWtHdTY1xQLpaLILtw6ayzQGkivbECR6kWuYMDanu9UXxfeAOEUrYqrHRAB2U2EJofD3BnmTWIgQCpjlauKCZiLefAxczrhdeABl86HGvcDJJ9m+ObEJmMav9SFJs134= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560337221; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=d1Nhqr2SAAM6zNzxztzKIDB0Ik0iBzQ+cGs0SzgZVfI=; b=QEdVXBJXD2wbVNSAHeyv9HxZpFD66Bgs86Wrrhn0FTma0EAY3kt9fW9h26XKRWzGrJzVxIRsmoSeixwmpzdJ53FjoGA/p/XtL8I/Kd6qhOiv64jfSa4sR6adCStoRImK35jjbvrisbsyyU11LE9/LKyyQ5eosr+q+wC9zdB+oWk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560337221920245.5283098194227; Wed, 12 Jun 2019 04:00:21 -0700 (PDT) Received: from localhost ([::1]:58784 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hb0zJ-0004Ak-NN for importer@patchew.org; Wed, 12 Jun 2019 07:00:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58701) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hb0o0-0003Hy-4b for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hb0ny-0002pS-A7 for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43926) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hb0ny-0002nY-2i for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:34 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0B46030872C1; Wed, 12 Jun 2019 10:48:26 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-241.ams2.redhat.com [10.36.116.241]) by smtp.corp.redhat.com (Postfix) with ESMTP id C0E3D46; Wed, 12 Jun 2019 10:48:23 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 12 Jun 2019 12:48:03 +0200 Message-Id: <20190612104808.6398-4-quintela@redhat.com> In-Reply-To: <20190612104808.6398-1-quintela@redhat.com> References: <20190612104808.6398-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Wed, 12 Jun 2019 10:48:28 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/8] migration-test: Add migration multifd test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , zhanghailiang , Juan Quintela , Markus Armbruster , "Dr. David Alan Gilbert" , Wei Yang , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We set multifd-channels. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Thomas Huth Tested-by: Wei Yang Signed-off-by: Juan Quintela --- tests/migration-test.c | 48 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/migration-test.c b/tests/migration-test.c index ebabca8820..36d4910192 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -1128,6 +1128,53 @@ static void test_migrate_fd_proto(void) test_migrate_end(from, to, true); } =20 +static void test_multifd_tcp(void) +{ + char *uri; + QTestState *from, *to; + + if (test_migrate_start(&from, &to, "tcp:127.0.0.1:0", false, false)) { + return; + } + + /* + * We want to pick a speed slow enough that the test completes + * quickly, but that it doesn't complete precopy even on a slow + * machine, so also set the downtime. + */ + /* 1 ms should make it not converge*/ + migrate_set_parameter_int(from, "downtime-limit", 1); + /* 1GB/s */ + migrate_set_parameter_int(from, "max-bandwidth", 1000000000); + + migrate_set_parameter_int(from, "multifd-channels", 2); + migrate_set_parameter_int(to, "multifd-channels", 2); + + migrate_set_capability(from, "multifd", "true"); + migrate_set_capability(to, "multifd", "true"); + /* Wait for the first serial output from the source */ + wait_for_serial("src_serial"); + + uri =3D migrate_get_socket_address(to, "socket-address"); + + migrate(from, uri, "{}"); + + wait_for_migration_pass(from); + + /* 300ms it should converge */ + migrate_set_parameter_int(from, "downtime-limit", 600); + + if (!got_stop) { + qtest_qmp_eventwait(from, "STOP"); + } + qtest_qmp_eventwait(to, "RESUME"); + + wait_for_serial("dest_serial"); + wait_for_migration_complete(from); + test_migrate_end(from, to, true); + free(uri); +} + int main(int argc, char **argv) { char template[] =3D "/tmp/migration-test-XXXXXX"; @@ -1183,6 +1230,7 @@ int main(int argc, char **argv) /* qtest_add_func("/migration/ignore_shared", test_ignore_shared); */ qtest_add_func("/migration/xbzrle/unix", test_xbzrle_unix); qtest_add_func("/migration/fd_proto", test_migrate_fd_proto); + qtest_add_func("/migration/multifd/tcp", test_multifd_tcp); =20 ret =3D g_test_run(); =20 --=20 2.21.0 From nobody Tue Apr 23 19:48:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1560336707; cv=none; d=zoho.com; s=zohoarc; b=aRk4EvCWpbwor3vZN+WZY5bLm0HDwPuKyrMwQcIRyx1rGnUpZ38wMVmJKHkupU80bny9dapp1av9UxCvhIUQCcA85IQN1cD3UaGfYDQIJQu6zeucKKiRBQEccQQfmIdksEZ9gmm1LyofLG+zXzhnLBIsc5Y0pa9EqWtItiHLX7w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560336707; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=4ha/82ztyCWproKhd6jXibJn+U13wEN7xczc2LZe28M=; b=ApVjf3HNzXhGITSpHdZ7k9Bb5vUk640egp1yNTxUMDjGTKD4x1LKj174AT1aZ3fUptClr4sa0cHkbtUpAVDjsTF1GEFXcMV1T1NqDlLB5bhCeoDpFtM7r3G2Dt7EDJhmD4gVFpJFn81np6UAPLgZ0Z36tjdMefkLfa11FKvaluc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560336707235167.7053921471271; Wed, 12 Jun 2019 03:51:47 -0700 (PDT) Received: from localhost ([::1]:58704 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hb0qz-0005Eo-1H for importer@patchew.org; Wed, 12 Jun 2019 06:51:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58691) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hb0nz-0003Hc-Rh for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hb0ny-0002pD-5v for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49260) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hb0nx-0002nm-TI for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:34 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B01C18830B; Wed, 12 Jun 2019 10:48:29 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-241.ams2.redhat.com [10.36.116.241]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5B8032719B; Wed, 12 Jun 2019 10:48:26 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 12 Jun 2019 12:48:04 +0200 Message-Id: <20190612104808.6398-5-quintela@redhat.com> In-Reply-To: <20190612104808.6398-1-quintela@redhat.com> References: <20190612104808.6398-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 12 Jun 2019 10:48:29 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/8] migration/multifd: call multifd_send_sync_main when sending RAM_SAVE_FLAG_EOS X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , zhanghailiang , Juan Quintela , Markus Armbruster , "Dr. David Alan Gilbert" , Wei Yang , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Wei Yang On receiving RAM_SAVE_FLAG_EOS, multifd_recv_sync_main() is called to synchronize receive threads. Current synchronization mechanism is to wait for each channel's sem_sync semaphore. This semaphore is triggered by a packet with MULTIFD_FLAG_SYNC flag. While in current implementation, we don't do multifd_send_sync_main() to send such packet when blk_mig_bulk_active() is true. This will leads to the receive threads won't notify multifd_recv_sync_main() by sem_sync. And multifd_recv_sync_main() will always wait there. [Note]: normal migration test works, while didn't test the blk_mig_bulk_active() case. Since not sure how to produce this situation. Signed-off-by: Wei Yang Reviewed-by: Juan Quintela Message-Id: <20190612014337.11255-1-richardw.yang@linux.intel.com> Signed-off-by: Juan Quintela --- migration/ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/ram.c b/migration/ram.c index 908517fc2b..74c9306c78 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -3466,8 +3466,8 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) */ ram_control_after_iterate(f, RAM_CONTROL_ROUND); =20 - multifd_send_sync_main(); out: + multifd_send_sync_main(); qemu_put_be64(f, RAM_SAVE_FLAG_EOS); qemu_fflush(f); ram_counters.transferred +=3D 8; --=20 2.21.0 From nobody Tue Apr 23 19:48:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1560336708; cv=none; d=zoho.com; s=zohoarc; b=IAY/+XlfKMnAAVP/tBXsVDib5IS6k+SOhxPjs10p+m9NjjjC+vplAm31H6Zj3rOvdN1A12lyNIdOpYR+6DgWSpHZSXPaWJUBjf2xtERwRCQfd6G9bBj4Qvu+9spIppNiswInQ8JI6axfZ6OvAfiRNvmHU7GihgJ9rmzzhbgpd/Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560336708; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=iA9/pDgM3tLV6eFd4Uf/me8qp6KvUoQu9/0TeNr00+8=; b=Y5LqrQy6HaucqTkX1FDMQxyuw6YfLv4WbPNKJ8rRpH8P/Jx+BsPpXpFPCtqyEFiqjo2mkpKATG159DNYG3VXrF2z9Tsyt+LZ2KCynW3lX0nv5dTu1LOfbbbaLzKiYSg8eNPMCU5v/TcfgLiPuvlYv0XT+sBNaVRKAifmI5UXjU4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560336708574960.2499994956381; Wed, 12 Jun 2019 03:51:48 -0700 (PDT) Received: from localhost ([::1]:58706 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hb0qz-0005HB-FY for importer@patchew.org; Wed, 12 Jun 2019 06:51:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58692) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hb0nz-0003Hd-TI for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hb0ny-0002p6-37 for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44456) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hb0nx-0002oG-RL for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:33 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4713F8667E; Wed, 12 Jun 2019 10:48:32 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-241.ams2.redhat.com [10.36.116.241]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0E04D177AD; Wed, 12 Jun 2019 10:48:29 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 12 Jun 2019 12:48:05 +0200 Message-Id: <20190612104808.6398-6-quintela@redhat.com> In-Reply-To: <20190612104808.6398-1-quintela@redhat.com> References: <20190612104808.6398-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 12 Jun 2019 10:48:32 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 5/8] migration/xbzrle: update cache and current_data in one place X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , zhanghailiang , Juan Quintela , Markus Armbruster , "Dr. David Alan Gilbert" , Wei Yang , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Wei Yang When we are not in the last_stage, we need to update the cache if page is not the same. Currently this procedure is scattered in two places and mixed with encoding status check. This patch extract this general step out to make the code a little bit easy to read. Signed-off-by: Wei Yang Reviewed-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Message-Id: <20190610004159.20966-1-richardw.yang@linux.intel.com> Signed-off-by: Juan Quintela --- migration/ram.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 74c9306c78..d3d72b6f4f 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1585,25 +1585,30 @@ static int save_xbzrle_page(RAMState *rs, uint8_t *= *current_data, encoded_len =3D xbzrle_encode_buffer(prev_cached_page, XBZRLE.current_= buf, TARGET_PAGE_SIZE, XBZRLE.encoded_bu= f, TARGET_PAGE_SIZE); + + /* + * Update the cache contents, so that it corresponds to the data + * sent, in all cases except where we skip the page. + */ + if (!last_stage && encoded_len !=3D 0) { + memcpy(prev_cached_page, XBZRLE.current_buf, TARGET_PAGE_SIZE); + /* + * In the case where we couldn't compress, ensure that the caller + * sends the data from the cache, since the guest might have + * changed the RAM since we copied it. + */ + *current_data =3D prev_cached_page; + } + if (encoded_len =3D=3D 0) { trace_save_xbzrle_page_skipping(); return 0; } else if (encoded_len =3D=3D -1) { trace_save_xbzrle_page_overflow(); xbzrle_counters.overflow++; - /* update data in the cache */ - if (!last_stage) { - memcpy(prev_cached_page, *current_data, TARGET_PAGE_SIZE); - *current_data =3D prev_cached_page; - } return -1; } =20 - /* we need to update the data in the cache, in order to get the same d= ata */ - if (!last_stage) { - memcpy(prev_cached_page, XBZRLE.current_buf, TARGET_PAGE_SIZE); - } - /* Send XBZRLE based compressed page */ bytes_xbzrle =3D save_page_header(rs, rs->f, block, offset | RAM_SAVE_FLAG_XBZRLE); --=20 2.21.0 From nobody Tue Apr 23 19:48:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1560337856; cv=none; d=zoho.com; s=zohoarc; b=PPgRBxp1aTsFNqIZqxn7R8xiesfiUe/CoGYEPcd8iQkjpEwFNSxCExacIyyZS65dYwFYx3FvlFFhgAUACWO4lOt+6t8pLCf/0oSkyxssm28alsWMj+0POfa5xxFmPJFu13H+5MRKZZrhq/ZhoBG8AxvmkWnpafsPE9I2EFP6XwQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560337856; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=6W6yHezxcVo2ajuISIt4piEXJgW4L7XKvUxzJ0C9kFw=; b=ZBe2a1QF8lnHaAZaI+uIv2GI4FwXP8XRI/EGY93IvSdNYqG7VOm5zZzkP2oQ4Fyj2/i6xPsh88AN46vexEdMxKQBGQ5J1Y3v4Fy1hnRQWBH93AgfkQ5z0bLPRNCmYcrboWVepU4xYLeBR+Hy3UWzHkvtqrUp3vSpUd5HCFm7Tu4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560337856581428.80101875070534; Wed, 12 Jun 2019 04:10:56 -0700 (PDT) Received: from localhost ([::1]:58822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hb19S-0000NB-VE for importer@patchew.org; Wed, 12 Jun 2019 07:10:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58748) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hb0o3-0003LT-1K for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hb0o1-0002r6-Sr for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53624) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hb0o1-0002qt-MQ for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:37 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0058C30842B0; Wed, 12 Jun 2019 10:48:37 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-241.ams2.redhat.com [10.36.116.241]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9BA8F46; Wed, 12 Jun 2019 10:48:32 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 12 Jun 2019 12:48:06 +0200 Message-Id: <20190612104808.6398-7-quintela@redhat.com> In-Reply-To: <20190612104808.6398-1-quintela@redhat.com> References: <20190612104808.6398-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Wed, 12 Jun 2019 10:48:37 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 6/8] cutils: remove one unnecessary pointer operation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , zhanghailiang , Juan Quintela , Markus Armbruster , "Dr. David Alan Gilbert" , Wei Yang , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Wei Yang Since we will not operate on the next address pointed by out, it is not necessary to do addition on it. After removing the operation, the function size reduced 16/18 bytes. Signed-off-by: Wei Yang Reviewed-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Message-Id: <20190610030852.16039-2-richardw.yang@linux.intel.com> Signed-off-by: Juan Quintela --- util/cutils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/cutils.c b/util/cutils.c index 9aacc422ca..1933a68da5 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -754,11 +754,11 @@ int uleb128_encode_small(uint8_t *out, uint32_t n) { g_assert(n <=3D 0x3fff); if (n < 0x80) { - *out++ =3D n; + *out =3D n; return 1; } else { *out++ =3D (n & 0x7f) | 0x80; - *out++ =3D n >> 7; + *out =3D n >> 7; return 2; } } @@ -766,7 +766,7 @@ int uleb128_encode_small(uint8_t *out, uint32_t n) int uleb128_decode_small(const uint8_t *in, uint32_t *n) { if (!(*in & 0x80)) { - *n =3D *in++; + *n =3D *in; return 1; } else { *n =3D *in++ & 0x7f; @@ -774,7 +774,7 @@ int uleb128_decode_small(const uint8_t *in, uint32_t *n) if (*in & 0x80) { return -1; } - *n |=3D *in++ << 7; + *n |=3D *in << 7; return 2; } } --=20 2.21.0 From nobody Tue Apr 23 19:48:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1560337423; cv=none; d=zoho.com; s=zohoarc; b=HVipVJ/sljMWqzT30ryXny6MTAy7cdlgEn7zXXVbbUY/V3Msz+eKEyuudxxntGIdQmJXel03J24UDNIqifHJqJboXKMmrDGT51U5gm/clxulnG84gdgbpU/MzlPqr1YE8S3eczF6CW4fwC2U23SC0KwqvxhbjRl9XZkj+XIjbdM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560337423; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=usT+4FFNUCsQC9s4772xJFZOZ+rWEM9Wf22QIlsdM8g=; b=im94b1KuEN8KznUG3y2TyOktEFvmoTE77ArXWyJAIUDUnt3uycJyfnF2k7aC0zOTahOZlqND3ebn45c4q1ASLza5s2YlpbA2kvJpqbCYmej4b8ydW8C3zRFBGtVNJqEl8D8AcMfQOiJDzlx5xPwjUuT2rgZmWFuM/gpU9VkauVY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560337423544941.0706024419669; Wed, 12 Jun 2019 04:03:43 -0700 (PDT) Received: from localhost ([::1]:58792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hb12X-0004qM-8f for importer@patchew.org; Wed, 12 Jun 2019 07:03:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58787) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hb0o9-0003XM-IS for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hb0o8-0002sa-H1 for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49324) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hb0o8-0002sM-5T for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:44 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 64E8885550; Wed, 12 Jun 2019 10:48:43 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-241.ams2.redhat.com [10.36.116.241]) by smtp.corp.redhat.com (Postfix) with ESMTP id 54A8946; Wed, 12 Jun 2019 10:48:37 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 12 Jun 2019 12:48:07 +0200 Message-Id: <20190612104808.6398-8-quintela@redhat.com> In-Reply-To: <20190612104808.6398-1-quintela@redhat.com> References: <20190612104808.6398-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 12 Jun 2019 10:48:43 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 7/8] migration/multifd: sync packet_num after all thread are done X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , zhanghailiang , Juan Quintela , Markus Armbruster , Peter Xu , "Dr. David Alan Gilbert" , Wei Yang , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Wei Yang Notification from recv thread is not ordered, which means we may be notified by one MultiFDRecvParams but adjust packet_num for another. Move the adjustment after we are sure each recv thread are sync-ed. Signed-off-by: Wei Yang Reviewed-by: Juan Quintela Reviewed-by: Peter Xu Message-Id: <20190604023540.26532-1-richardw.yang@linux.intel.com> Signed-off-by: Juan Quintela --- migration/ram.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index d3d72b6f4f..96c84f770a 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1291,15 +1291,15 @@ static void multifd_recv_sync_main(void) =20 trace_multifd_recv_sync_main_wait(p->id); qemu_sem_wait(&multifd_recv_state->sem_sync); + } + for (i =3D 0; i < migrate_multifd_channels(); i++) { + MultiFDRecvParams *p =3D &multifd_recv_state->params[i]; + qemu_mutex_lock(&p->mutex); if (multifd_recv_state->packet_num < p->packet_num) { multifd_recv_state->packet_num =3D p->packet_num; } qemu_mutex_unlock(&p->mutex); - } - for (i =3D 0; i < migrate_multifd_channels(); i++) { - MultiFDRecvParams *p =3D &multifd_recv_state->params[i]; - trace_multifd_recv_sync_main_signal(p->id); qemu_sem_post(&p->sem_sync); } --=20 2.21.0 From nobody Tue Apr 23 19:48:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1560336906; cv=none; d=zoho.com; s=zohoarc; b=QqVj7yOvo6DoyMwGUzVdd/CRvLo+sVjPNh6hMwFoGpqwHudoj2m9QoIpYZ76VPnNxzFWG71YOJKIyIZidZc9mc62Dj89xpAOvbgs2ea2K9Qzo3SBnyJQu249f9a0BkIu8BoaUqU5enCwJonF6aHnFgUpSICd6pz7pSSa1tZS/EU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560336906; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=y9+VOPS6GBlcl3vDSO8XKWBBQw9Jt2CY6b64YmbTW9U=; b=QH+613Ez4sLraQuef0hngKN+Spqwkrdq3SFFYYV8BK7ws00GMzNj1RvnpF4etfcIYpyn/RGXy4Kdj4yiWpDNLdsxm+xAOTMxEVRzbJW/JGZ4hteFiRtdjUg6THi/ry6a/ZjuDfB65sXvRaXEDUXXxiP0R0aW9h6ZlG7IMZ5HN9E= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560336906184584.4807317457519; Wed, 12 Jun 2019 03:55:06 -0700 (PDT) Received: from localhost ([::1]:58742 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hb0uH-0000tm-2y for importer@patchew.org; Wed, 12 Jun 2019 06:55:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58827) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hb0oD-0003YE-Kv for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hb0oA-0002th-Vh for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34296) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hb0oA-0002tQ-Lb for qemu-devel@nongnu.org; Wed, 12 Jun 2019 06:48:46 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F12F73082141; Wed, 12 Jun 2019 10:48:45 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-241.ams2.redhat.com [10.36.116.241]) by smtp.corp.redhat.com (Postfix) with ESMTP id B907B46; Wed, 12 Jun 2019 10:48:43 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 12 Jun 2019 12:48:08 +0200 Message-Id: <20190612104808.6398-9-quintela@redhat.com> In-Reply-To: <20190612104808.6398-1-quintela@redhat.com> References: <20190612104808.6398-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Wed, 12 Jun 2019 10:48:46 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 8/8] migratioin/ram.c: reset complete_round when we gets a queued page X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , zhanghailiang , Juan Quintela , Markus Armbruster , "Dr. David Alan Gilbert" , Wei Yang , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Wei Yang In case we gets a queued page, the order of block is interrupted. We may not rely on the complete_round flag to say we have already searched the whole blocks on the list. Signed-off-by: Wei Yang Reviewed-by: Juan Quintela Message-Id: <20190605010828.6969-1-richardw.yang@linux.intel.com> Signed-off-by: Juan Quintela --- migration/ram.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/migration/ram.c b/migration/ram.c index 96c84f770a..89eec7ee9d 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2286,6 +2286,12 @@ static bool get_queued_page(RAMState *rs, PageSearch= Status *pss) */ pss->block =3D block; pss->page =3D offset >> TARGET_PAGE_BITS; + + /* + * This unqueued page would break the "one round" check, even is + * really rare. + */ + pss->complete_round =3D false; } =20 return !!block; --=20 2.21.0