From patchwork Thu Mar 22 18:17:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Perevalov X-Patchwork-Id: 889535 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=samsung.com header.i=@samsung.com header.b="MGGdCOAq"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 406Zl86cJ1z9s27 for ; Fri, 23 Mar 2018 05:22:12 +1100 (AEDT) Received: from localhost ([::1]:34161 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ez4qo-00026O-4p for incoming@patchwork.ozlabs.org; Thu, 22 Mar 2018 14:22:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ez4mb-00079I-P3 for qemu-devel@nongnu.org; Thu, 22 Mar 2018 14:17:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ez4mY-0000bN-IT for qemu-devel@nongnu.org; Thu, 22 Mar 2018 14:17:49 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:44915) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ez4mY-0000aB-4b for qemu-devel@nongnu.org; Thu, 22 Mar 2018 14:17:46 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180322181742euoutp02dafd9cfddb2ec49b377c4c2bd3f39386~eUOOEeS-q2648026480euoutp02A; Thu, 22 Mar 2018 18:17:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180322181742euoutp02dafd9cfddb2ec49b377c4c2bd3f39386~eUOOEeS-q2648026480euoutp02A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1521742662; bh=ag0oIYMIFoS+nI0J+p+SpGPaPEWZ+mqn7mE+ymBAxYg=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=MGGdCOAqCeMKGs3zEK6eedesbZnquuJZSdCatDYHLula1yX4Sy28x9VaFJeTow/7s 12otJnULHjFq9ebpz+raUjxoreOIepSccER+vZWiOi4Fsrzygkb0ufblsqtcdPf8oI J6aGrffE23m0ueRyvgtWX+ngPHTSl35PFUkgzTIw= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180322181741eucas1p13845ae17eaafe9f4fb34d52151fcf981~eUONM4cKI0199801998eucas1p1r; Thu, 22 Mar 2018 18:17:41 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 45.0E.10409.443F3BA5; Thu, 22 Mar 2018 18:17:40 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180322181740eucas1p2a7bde534f74bd8376fc521a4ad1bcfdb~eUOMB8Czv2588225882eucas1p2c; Thu, 22 Mar 2018 18:17:40 +0000 (GMT) X-AuditID: cbfec7f5-b45ff700000028a9-4f-5ab3f344e317 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id AE.29.04178.343F3BA5; Thu, 22 Mar 2018 18:17:39 +0000 (GMT) Received: from aperevalov-ubuntu.rnd.samsung.ru ([106.109.129.199]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P60001OD857D350@eusync4.samsung.com>; Thu, 22 Mar 2018 18:17:39 +0000 (GMT) From: Alexey Perevalov To: qemu-devel@nongnu.org, dgilbert@redhat.com Date: Thu, 22 Mar 2018 21:17:22 +0300 Message-id: <1521742647-25550-2-git-send-email-a.perevalov@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <1521742647-25550-1-git-send-email-a.perevalov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJIsWRmVeSWpSXmKPExsWy7djPc7ounzdHGbybb2Ux9+55FouVk5cw WfRuu8ducWLTQWaLTw1SFlv2f2O3ON67g8XizpY+JovTNzezO3B6HHixkN3jybXNTB7v911l 8+jbsooxgCWKyyYlNSezLLVI3y6BK2PBp9nsBe+EK6Y/vsDWwDhXoIuRk0NCwETi69KnbF2M XBxCAisYJR7uWMMM4XxmlFh3cyYbTNWPjafYIRLLGCW+LpsNVdXNJHH00F+gKg4ONgEDiX33 bEFMEQE9iQlXI0FKmAU2MkrsvPOeBWSQsICXxLo3D5hBalgEVCUO7koECfMKuEt0PPrFBLFL TuLmuU5mEJtTwENi761NjCBzJAQmsEncO30M6iAXiUsHNrJA2MISr45vYYewZSQ6Ow4yQTS0 M0rc3XiVFaob6J3Jx5ghquwlTt28CraOWYBPYtK26WAXSQjwSnS0CUGUeEjcPHmVHSLsKPH1 ggTEv7MZJZ79u8U+gVFqASPDKkbx1NLi3PTUYuO81HK94sTc4tK8dL3k/NxNjMAIPf3v+Ncd jPv+JB1iFOBgVOLh/XBkc5QQa2JZcWXuIUYJDmYlEd78tUAh3pTEyqrUovz4otKc1OJDjNIc LErivHEadVFCAumJJanZqakFqUUwWSYOTqkGxsazmwXe8nRyP2kRf7uPp0/mcY6rktLlHeUf roWfW7dcraTEtVOEW5+Vl/fBijP2ZTk22S4871t0X7dy1Ikvusm6esrU7nVh/z0Xvdz6+wXb cvsnfVfsD5ywyRCb/0nmb9S+/+ePBbQeKeR/ELblwuOFP39LSfic2DwpR+/k9/ptOh8P7fl8 +rwSS3FGoqEWc1FxIgCJFGiJzAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupkluLIzCtJLcpLzFFi42I5/e/4NV3nz5ujDDa/tbGYe/c8i8XKyUuY LHq33WO3OLHpILPFpwYpiy37v7FbHO/dwWJxZ0sfk8Xpm5vZHTg9DrxYyO7x5NpmJo/3+66y efRtWcUYwBLFZZOSmpNZllqkb5fAlbHg02z2gnfCFdMfX2BrYJwr0MXIySEhYCLxY+MpdhBb SGAJo8TTwyZdjFxAdi+TxLtLE1m7GDk42AQMJPbdswUxRQT0JCZcjQQpYRbYyCjxa8ZdVpBe YQEviXVvHjCD1LAIqEoc3JUIEuYVcJfoePSLCWKVnMTNc53MIDangIfE3lubGCHWukvsunCN eQIjzwJGhlWMIqmlxbnpucWGesWJucWleel6yfm5mxiBAbTt2M/NOxgvbQw+xCjAwajEwzvj 0OYoIdbEsuLK3EOMEhzMSiK8+WuBQrwpiZVVqUX58UWlOanFhxilOViUxHnPG1RGCQmkJ5ak ZqemFqQWwWSZODilGhinPTopZ2zS8EpLfzHDnV8vOlR/VVt6ynxb+7l8bVnJ/s+zrgf0Wjje 1P+0YoWgi8vTdfP+ztIU7qiYLv1rXbnmk5vrbpx/ouPy4k88g9YmsfXZLHa867/K/PSLYdZZ v2jd6dIqtoOil5kPyZzaaOSx7USc5nUfIf+A+5oh7KGCr9Z5TutQsn6lxFKckWioxVxUnAgA 6s9JZhwCAAA= X-CMS-MailID: 20180322181740eucas1p2a7bde534f74bd8376fc521a4ad1bcfdb X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180322181740eucas1p2a7bde534f74bd8376fc521a4ad1bcfdb X-RootMTR: 20180322181740eucas1p2a7bde534f74bd8376fc521a4ad1bcfdb References: <1521742647-25550-1-git-send-email-a.perevalov@samsung.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 210.118.77.12 Subject: [Qemu-devel] [PATCH v2 1/6] migration: introduce postcopy-blocktime capability 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: lvivier@redhat.com, v.kuramshin@samsung.com, quintela@redhat.com, ash.billore@samsung.com, Alexey Perevalov , peterx@redhat.com, f4bug@amsat.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Right now it could be used on destination side to enable vCPU blocktime calculation for postcopy live migration. vCPU blocktime - it's time since vCPU thread was put into interruptible sleep, till memory page was copied and thread awake. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Alexey Perevalov Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/migration.c | 9 +++++++++ migration/migration.h | 1 + qapi/migration.json | 6 +++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index fc629e5..f95a7f3 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1540,6 +1540,15 @@ bool migrate_zero_blocks(void) return s->enabled_capabilities[MIGRATION_CAPABILITY_ZERO_BLOCKS]; } +bool migrate_postcopy_blocktime(void) +{ + MigrationState *s; + + s = migrate_get_current(); + + return s->enabled_capabilities[MIGRATION_CAPABILITY_POSTCOPY_BLOCKTIME]; +} + bool migrate_use_compression(void) { MigrationState *s; diff --git a/migration/migration.h b/migration/migration.h index 8d2f320..46a50bc 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -230,6 +230,7 @@ int migrate_compress_level(void); int migrate_compress_threads(void); int migrate_decompress_threads(void); bool migrate_use_events(void); +bool migrate_postcopy_blocktime(void); /* Sending on the return path - generic and then for each message type */ void migrate_send_rp_shut(MigrationIncomingState *mis, diff --git a/qapi/migration.json b/qapi/migration.json index 9d0bf82..24bfc19 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -354,16 +354,20 @@ # # @x-multifd: Use more than one fd for migration (since 2.11) # +# # @dirty-bitmaps: If enabled, QEMU will migrate named dirty bitmaps. # (since 2.12) # +# @postcopy-blocktime: Calculate downtime for postcopy live migration +# (since 2.13) +# # Since: 1.2 ## { 'enum': 'MigrationCapability', 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks', 'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram', 'block', 'return-path', 'pause-before-switchover', 'x-multifd', - 'dirty-bitmaps' ] } + 'dirty-bitmaps', 'postcopy-blocktime' ] } ## # @MigrationCapabilityStatus: