From patchwork Fri May 12 13:31:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Perevalov X-Patchwork-Id: 9724179 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 97C5060387 for ; Fri, 12 May 2017 13:33:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DCC82880B for ; Fri, 12 May 2017 13:33:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82A7328822; Fri, 12 May 2017 13:33:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 632EF2880B for ; Fri, 12 May 2017 13:33:07 +0000 (UTC) Received: from localhost ([::1]:53834 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9Ags-0005QO-Hy for patchwork-qemu-devel@patchwork.kernel.org; Fri, 12 May 2017 09:33:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9Afi-0005O3-Tl for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9Afd-000726-SU for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:54 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:56136) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d9Afd-000716-Nc for qemu-devel@nongnu.org; Fri, 12 May 2017 09:31:49 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OPU00BRGDKX2U00@mailout4.w1.samsung.com> for qemu-devel@nongnu.org; Fri, 12 May 2017 14:31:47 +0100 (BST) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170512133147eucas1p28c2a7830c7c88031dc6480ef6c35cbbb~93w8VTK3e0943009430eucas1p2I; Fri, 12 May 2017 13:31:47 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 7B.94.04459.249B5195; Fri, 12 May 2017 14:31:46 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170512133146eucas1p2ba4841cabf508b66410fae6784952eaa~93w7vwGyL0605406054eucas1p2U; Fri, 12 May 2017 13:31:46 +0000 (GMT) X-AuditID: cbfec7f1-f796e6d00000116b-78-5915b9428344 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id ED.8E.17452.5D9B5195; Fri, 12 May 2017 14:34:14 +0100 (BST) Received: from aperevalov-ubuntu.rnd.samsung.ru ([106.109.129.199]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OPU00791DKM5L30@eusync1.samsung.com>; Fri, 12 May 2017 14:31:46 +0100 (BST) From: Alexey Perevalov To: qemu-devel@nongnu.org Date: Fri, 12 May 2017 16:31:22 +0300 Message-id: <1494595886-30912-6-git-send-email-a.perevalov@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1494595886-30912-1-git-send-email-a.perevalov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrKIsWRmVeSWpSXmKPExsWy7djP87pOO0UjDWZ/tbaYe/c8i0Xvtnvs Flfaf7JbbNn/jd3ieO8OFgdWjyfXNjN5vN93lc2jb8sqxgDmKC6blNSczLLUIn27BK6M711v 2QtahSoOnn3C0sD4ga+LkZNDQsBEomHFCSYIW0ziwr31bF2MXBxCAksZJWbf2scC4XxmlNg2 /QNzFyMHWMfWpb4Q8WWMEnsv7mSGcLqZJM6uuMUIUsQmYCCx754tyFQRAUmJ312nmUFsZoFY ibfXr7GB2MICXhL352xnB7FZBFQllnb3gl3BK+Au8erBdVaIi+QkTh6bDGZzCnhIPL57ixVk l4TAdTaJV3tOskAcJCux6QAzRL2LRP/Uh2wQtrDEq+Nb2CFsGYnOjoNMEL3tjBLdOzuhBk1g lDgz/S9Ulb3EqZtXmSAu5ZOYtG061Me8Eh1tQhAlHhKfv/RALXOUmH//LthxQgKzGSUeT6+e wCizgJFhFaNIamlxbnpqsZFecWJucWleul5yfu4mRmBknv53/OMOxvcnrA4xCnAwKvHwKqwV jRRiTSwrrsw9xCjBwawkwmu4BSjEm5JYWZValB9fVJqTWnyIUZqDRUmcl+vUtQghgfTEktTs 1NSC1CKYLBMHp1QD4/T9C3+l6mzcOeHMndy5P28yZ0wuO7E47YlCdtnX2rbgOT5NVWVr02+7 O7n+kDsk4Cbvw/N8e2LpnYP3U4OaGOoly4/N/XS+3FNKQm2m4KnmU+48BiuWnmL409emVG9c 2Nw4Xdo38vLrn9llKom8jBtC03fEXJvGoh0spWrCaiDKqxu/JuCaEktxRqKhFnNRcSIABsxm jMgCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCLMWRmVeSWpSXmKPExsVy+t/xy7rXdopGGsyazmgx9+55FovebffY La60/2S32LL/G7vF8d4dLA6sHk+ubWbyeL/vKptH35ZVjAHMUW42GamJKalFCql5yfkpmXnp tkqhIW66FkoKeYm5qbZKEbq+IUFKCmWJOaVAnpEBGnBwDnAPVtK3S3DL+N71lr2gVaji4Nkn LA2MH/i6GDk4JARMJLYu9e1i5AQyxSQu3FvP1sXIxSEksIRR4syuhVBOL5PE1bmHWEEa2AQM JPbdswVpEBGQlPjddZoZxGYWiJW4NOEFG4gtLOAlcX/OdnYQm0VAVWJpdy8TiM0r4C7x6sF1 VohlchInj00GszkFPCQe370FZgsB1WxrWMo2gZF3ASPDKkaR1NLi3PTcYkO94sTc4tK8dL3k /NxNjMAQ3Xbs5+YdjJc2Bh9iFOBgVOLhVVgrGinEmlhWXJl7iFGCg1lJhNdwC1CINyWxsiq1 KD++qDQntfgQoynQUROZpUST84Hxk1cSb2hiaG5paGRsYWFuZKQkzlvy4Uq4kEB6Yklqdmpq QWoRTB8TB6dUA6PL38ZvclNk513jfJ68Oipn/oLMExf8RFrPJ83O+3YlYeOig33RQXv0i+IP JqgmbHSbZDk9bvnL+oQI7kXumeeqQz5+OHuqY1nJIgYD8YvL9ufZR89O/HN/r0dy9twHn13X fjNrOS5e2J0q/f2A9VXpNcv3LN2lfZHbZlrazQnXZS/nxgrvOrNGiaU4I9FQi7moOBEAq2+C sGcCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170512133146eucas1p2ba4841cabf508b66410fae6784952eaa X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?QWxleGV5IFBlcmV2YWxvdhtTUlItVmlydHVhbGl6YXRpb24g?= =?UTF-8?B?TGFiG+yCvOyEseyghOyekBtTZW5pb3IgRW5naW5lZXI=?= X-Global-Sender: =?UTF-8?B?QWxleGV5IFBlcmV2YWxvdhtTUlItVmlydHVhbGl6YXRpb24g?= =?UTF-8?B?TGFiG1NhbXN1bmcgRWxlY3Ryb25pY3MbU2VuaW9yIEVuZ2luZWVy?= X-Sender-Code: =?UTF-8?B?QzEwG0NJU0hRG0MxMEdEMDFHRDAxMDE1NA==?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170512133146eucas1p2ba4841cabf508b66410fae6784952eaa X-RootMTR: 20170512133146eucas1p2ba4841cabf508b66410fae6784952eaa References: <1494595886-30912-1-git-send-email-a.perevalov@samsung.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 210.118.77.14 Subject: [Qemu-devel] [PATCH V5 5/9] 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: i.maximets@samsung.com, dgilbert@redhat.com, peterx@redhat.com, a.perevalov@samsung.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Alexey Perevalov Reviewed-by: Dr. David Alan Gilbert --- include/migration/migration.h | 1 + migration/migration.c | 9 +++++++++ qapi-schema.json | 5 ++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index ba1a16c..82bbcd8 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -315,6 +315,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_message(MigrationIncomingState *mis, diff --git a/migration/migration.c b/migration/migration.c index 569a7f6..c0443ce 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1371,6 +1371,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/qapi-schema.json b/qapi-schema.json index 01b087f..fde6d63 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -894,11 +894,14 @@ # @release-ram: if enabled, qemu will free the migrated ram pages on the source # during postcopy-ram migration. (since 2.9) # +# @postcopy-blocktime: Calculate downtime for postcopy live migration (since 2.10) +# # Since: 1.2 ## { 'enum': 'MigrationCapability', 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks', - 'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram'] } + 'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram', + 'postcopy-blocktime'] } ## # @MigrationCapabilityStatus: