From patchwork Fri Jun 16 19:12:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Perevalov X-Patchwork-Id: 9793421 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 AE2C360231 for ; Fri, 16 Jun 2017 19:16:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E78C2841D for ; Fri, 16 Jun 2017 19:16:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9367A28558; Fri, 16 Jun 2017 19:16:20 +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 2EF902841D for ; Fri, 16 Jun 2017 19:16:20 +0000 (UTC) Received: from localhost ([::1]:60464 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLwjD-0001EJ-AG for patchwork-qemu-devel@patchwork.kernel.org; Fri, 16 Jun 2017 15:16:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLwfW-0007Aq-EP for qemu-devel@nongnu.org; Fri, 16 Jun 2017 15:12:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLwfS-0007RX-AP for qemu-devel@nongnu.org; Fri, 16 Jun 2017 15:12:30 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:12201) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dLwfS-0007Qq-3e for qemu-devel@nongnu.org; Fri, 16 Jun 2017 15:12:26 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0ORN00LR5MOO6I40@mailout2.w1.samsung.com> for qemu-devel@nongnu.org; Fri, 16 Jun 2017 20:12:24 +0100 (BST) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170616191223eucas1p10c3f863f649cd19ede2b319e0bd9f5bd~Ir-UnJXdW3158031580eucas1p1w; Fri, 16 Jun 2017 19:12:23 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges4.samsung.com (EUCPMTA) with SMTP id D9.48.04729.79D24495; Fri, 16 Jun 2017 20:12:23 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170616191222eucas1p186aab01cb769c9c2f7a1b61be48cd9a2~Ir-Tp8T4i0327603276eucas1p1W; Fri, 16 Jun 2017 19:12:22 +0000 (GMT) X-AuditID: cbfec7f4-f79806d000001279-46-59442d97e13b Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 23.9C.17452.69D24495; Fri, 16 Jun 2017 20:12:22 +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 <0ORN00K65MO9DC10@eusync1.samsung.com>; Fri, 16 Jun 2017 20:12:22 +0100 (BST) From: Alexey Perevalov To: qemu-devel@nongnu.org Date: Fri, 16 Jun 2017 22:12:02 +0300 Message-id: <1497640325-10960-6-git-send-email-a.perevalov@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1497640325-10960-1-git-send-email-a.perevalov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrNIsWRmVeSWpSXmKPExsWy7djPc7rTdV0iDW7+ErKYe/c8i0Xvtnvs Flfaf7JbbNn/jd3ieO8OFos7W/qYHNg8nlzbzOTxft9VNo++LasYA5ijuGxSUnMyy1KL9O0S uDIO9dxhKVgtWHH97jLmBsYevi5GTg4JAROJ5h/P2CFsMYkL99azdTFycQgJLGWUePZhIpTz Gci5vJUVpuP2ocXMEIlljBJ7L35nh3C6mSQ2Tl0DVMXBwSZgILHvni1Ig4iApMTvrtNgDcwC rYwS7X2PmEESwgJeEh/7LrGA2CwCqhJ/7z9jArF5BdwlJs9+zwKxTU7i5LHJYDM5BTwkjm/y A5kjIfCYTeLPkSY2kLiEgKzEpgPMEOUuElOvvoSyhSVeHd8C9ZqMRGfHQSaI3nZGie6dnawQ zgRGiTPT/0JV2UucunkV7AhmAT6JSdumM0Ms4JXoaBOCKPGQWHlwAtReR4lPr+wgfp/NKPGn 5x7bBEaZBYwMqxhFUkuLc9NTi030ihNzi0vz0vWS83M3MQKj9PS/4192MC4+ZnWIUYCDUYmH l+G2c6QQa2JZcWXuIUYJDmYlEV57HZdIId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rxcp65FCAmk J5akZqemFqQWwWSZODilGhjtnp+8/2LCP5vph59cCHEoOH343f7zekFXOJZ8vich8CVB9b7m bTGzGiu/d5LbBZave2m/a6uxQ4nq5iZ7jZknjHdY5J2WSF//VPYUq/a+6PSZaqqHlV4sE/0o rz/r/F/bK0VXsj5Un+x6Kj7XQPpsaCWH05Q2qfcebioR73RXbE3/Jls1U+6dEktxRqKhFnNR cSIAlTArLc4CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFLMWRmVeSWpSXmKPExsVy+t/xy7rTdF0iDaZMlLOYe/c8i0Xvtnvs Flfaf7JbbNn/jd3ieO8OFos7W/qYHNg8nlzbzOTxft9VNo++LasYA5ij3GwyUhNTUosUUvOS 81My89JtlUJD3HQtlBTyEnNTbZUidH1DgpQUyhJzSoE8IwM04OAc4B6spG+X4JZxqOcOS8Fq wYrrd5cxNzD28HUxcnJICJhI3D60mBnCFpO4cG89WxcjF4eQwBJGifs7FzJBOL1MEgfvTWHt YuTgYBMwkNh3zxakQURAUuJ312lmkBpmgVZGiSeNs9hBEsICXhIf+y6xgNgsAqoSf+8/YwKx eQXcJSbPfs8CsU1O4uSxyWAzOQU8JI5v8gMJCwGVbNmyg2UCI+8CRoZVjCKppcW56bnFhnrF ibnFpXnpesn5uZsYgeG67djPzTsYL20MPsQowMGoxMPLcNs5Uog1say4MvcQowQHs5IIr72O S6QQb0piZVVqUX58UWlOavEhRlOgmyYyS4km5wNjKa8k3tDE0NzS0MjYwsLcyEhJnLfkw5Vw IYH0xJLU7NTUgtQimD4mDk6pBkbPKd7/D8jyt51ZZL5ONvbmzuOrvM+Esi0xya0WOPSJySOm 2yEoZqX5m5IUtSfLs+b+VrY8seGJhvGiNBkLtp+3TixwmRDRpt3TXKXwc9vuBWJLb3sY9yf+ vR7mZPp5X/7kY7YrVDe322Y9lOYWPfUt5NSNx4Kt+sUay1tbNPwicu4lBSx/t0KJpTgj0VCL uag4EQBvkbJgbQIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170616191222eucas1p186aab01cb769c9c2f7a1b61be48cd9a2 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: 20170616191222eucas1p186aab01cb769c9c2f7a1b61be48cd9a2 X-RootMTR: 20170616191222eucas1p186aab01cb769c9c2f7a1b61be48cd9a2 References: <1497640325-10960-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.12 Subject: [Qemu-devel] [PATCH v9 5/8] 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, Alexey Perevalov , peterx@redhat.com, quintela@redhat.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. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Alexey Perevalov --- migration/migration.c | 9 +++++++++ migration/migration.h | 1 + qapi-schema.json | 5 ++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index 56929dc..f920ddf 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1233,6 +1233,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 601e4ab..cf4d04e 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -152,6 +152,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-schema.json b/qapi-schema.json index 4b50b65..e906953 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -900,12 +900,15 @@ # offers more flexibility. # (Since 2.10) # +# @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', - 'block' ] } + 'block', 'postcopy-blocktime'] } ## # @MigrationCapabilityStatus: