From patchwork Sun Apr 21 21:17:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mrhines@linux.vnet.ibm.com X-Patchwork-Id: 238262 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B34892C00E9 for ; Mon, 22 Apr 2013 07:21:07 +1000 (EST) Received: from localhost ([::1]:48153 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UU1h3-0002h0-Sr for incoming@patchwork.ozlabs.org; Sun, 21 Apr 2013 17:21:05 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UU1ed-0007dB-LS for qemu-devel@nongnu.org; Sun, 21 Apr 2013 17:18:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UU1eS-0008CE-Du for qemu-devel@nongnu.org; Sun, 21 Apr 2013 17:18:35 -0400 Received: from e7.ny.us.ibm.com ([32.97.182.137]:41219) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UU1eS-0008Ba-AO for qemu-devel@nongnu.org; Sun, 21 Apr 2013 17:18:24 -0400 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 21 Apr 2013 17:18:24 -0400 Received: from d01dlp02.pok.ibm.com (9.56.250.167) by e7.ny.us.ibm.com (192.168.1.107) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 21 Apr 2013 17:18:22 -0400 Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 469F36E8040 for ; Sun, 21 Apr 2013 17:18:19 -0400 (EDT) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r3LLILnZ57933866 for ; Sun, 21 Apr 2013 17:18:21 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r3LLILXh024033 for ; Sun, 21 Apr 2013 18:18:21 -0300 Received: from mrhinesdev.klabtestbed.com (klinux.watson.ibm.com [9.2.208.21]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r3LLIJhg023852; Sun, 21 Apr 2013 18:18:21 -0300 From: mrhines@linux.vnet.ibm.com To: qemu-devel@nongnu.org Date: Sun, 21 Apr 2013 17:17:59 -0400 Message-Id: <1366579081-6857-11-git-send-email-mrhines@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1366579081-6857-1-git-send-email-mrhines@linux.vnet.ibm.com> References: <1366579081-6857-1-git-send-email-mrhines@linux.vnet.ibm.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13042121-5806-0000-0000-000020CF9DEA X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 32.97.182.137 Cc: aliguori@us.ibm.com, quintela@redhat.com, owasserm@redhat.com, abali@us.ibm.com, mrhines@us.ibm.com, gokul@us.ibm.com, pbonzini@redhat.com Subject: [Qemu-devel] [PATCH v5 10/12] rdma: introduce capability x-rdma-pin-all X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Michael R. Hines" This capability allows you to disable dynamic chunk registration for better throughput on high-performance links. For example, using an 8GB RAM virtual machine with all 8GB of memory in active use and the VM itself is completely idle using a 40 gbps infiniband link: 1. x-pin-all disabled total time: approximately 7.5 seconds @ 9.5 Gbps 2. x-pin-all enabled total time: approximately 4 seconds @ 26 Gbps These numbers would of course scale up to whatever size virtual machine you have to migrate using RDMA. Enabling this feature does *not* have any measurable affect on migration *downtime*. This is because, without this feature, all of the memory will have already been registered already in advance during the bulk round and does not need to be re-registered during the successive iteration rounds. Signed-off-by: Michael R. Hines Reviewed-by: Eric Blake --- include/migration/migration.h | 2 ++ migration.c | 9 +++++++++ qapi-schema.json | 7 ++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index d173bd9..3b4d5e9 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -122,6 +122,8 @@ void migrate_add_blocker(Error *reason); */ void migrate_del_blocker(Error *reason); +bool migrate_rdma_pin_all(void); + int xbzrle_encode_buffer(uint8_t *old_buf, uint8_t *new_buf, int slen, uint8_t *dst, int dlen); int xbzrle_decode_buffer(uint8_t *src, int slen, uint8_t *dst, int dlen); diff --git a/migration.c b/migration.c index 48b5174..b13fa66 100644 --- a/migration.c +++ b/migration.c @@ -476,6 +476,15 @@ void qmp_migrate_set_downtime(double value, Error **errp) max_downtime = (uint64_t)value; } +bool migrate_rdma_pin_all(void) +{ + MigrationState *s; + + s = migrate_get_current(); + + return s->enabled_capabilities[MIGRATION_CAPABILITY_X_RDMA_PIN_ALL]; +} + int migrate_use_xbzrle(void) { MigrationState *s; diff --git a/qapi-schema.json b/qapi-schema.json index cc846c3..b73e30a 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -602,10 +602,15 @@ # This feature allows us to minimize migration traffic for certain work # loads, by sending compressed difference of the pages # +# @x-rdma-pin-all: (since 1.5) Controls whether or not the entire VM memory footprint is +# mlock()'d on demand or all at once. Refer to docs/rdma.txt for advice on usage. +# Disabled by default. Experimental: may (or may not) be renamed after +# further testing is complete. +# # Since: 1.2 ## { 'enum': 'MigrationCapability', - 'data': ['xbzrle'] } + 'data': ['xbzrle', 'x-rdma-pin-all'] } ## # @MigrationCapabilityStatus