yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
9ae3a8
From e3995aaa436e2ec92e720ff17855c6460dbc3761 Mon Sep 17 00:00:00 2001
9ae3a8
Message-Id: <e3995aaa436e2ec92e720ff17855c6460dbc3761.1387382496.git.minovotn@redhat.com>
9ae3a8
In-Reply-To: <c5386144fbf09f628148101bc674e2421cdd16e3.1387382496.git.minovotn@redhat.com>
9ae3a8
References: <c5386144fbf09f628148101bc674e2421cdd16e3.1387382496.git.minovotn@redhat.com>
9ae3a8
From: Nigel Croxon <ncroxon@redhat.com>
9ae3a8
Date: Thu, 14 Nov 2013 22:52:47 +0100
9ae3a8
Subject: [PATCH 11/46] rdma: introduce capability x-rdma-pin-all
9ae3a8
9ae3a8
RH-Author: Nigel Croxon <ncroxon@redhat.com>
9ae3a8
Message-id: <1384469598-13137-12-git-send-email-ncroxon@redhat.com>
9ae3a8
Patchwork-id: 55696
9ae3a8
O-Subject: [RHEL7.0 PATCH 11/42] rdma: introduce capability x-rdma-pin-all
9ae3a8
Bugzilla: 1011720
9ae3a8
RH-Acked-by: Orit Wasserman <owasserm@redhat.com>
9ae3a8
RH-Acked-by: Amit Shah <amit.shah@redhat.com>
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
9ae3a8
Bugzilla: 1011720
9ae3a8
https://bugzilla.redhat.com/show_bug.cgi?id=1011720
9ae3a8
9ae3a8
>From commit ID:
9ae3a8
commit 60d9222c8f50c3e5dd3df9ee84ddd1d1c4b35389
9ae3a8
Author: Michael R. Hines <mrhines@us.ibm.com>
9ae3a8
Date:   Tue Jun 25 21:35:36 2013 -0400
9ae3a8
9ae3a8
    rdma: introduce capability x-rdma-pin-all
9ae3a8
9ae3a8
    This capability allows you to disable dynamic chunk registration
9ae3a8
    for better throughput on high-performance links.
9ae3a8
9ae3a8
    For example, using an 8GB RAM virtual machine with all 8GB of memory in
9ae3a8
    active use and the VM itself is completely idle using a 40 gbps infiniband link:
9ae3a8
9ae3a8
    1. x-rdma-pin-all disabled total time: approximately 7.5 seconds @ 9.5 Gbps
9ae3a8
    2. x-rdma-pin-all enabled total time: approximately 4 seconds @ 26 Gbps
9ae3a8
9ae3a8
    These numbers would of course scale up to whatever size virtual machine
9ae3a8
    you have to migrate using RDMA.
9ae3a8
9ae3a8
    Enabling this feature does *not* have any measurable affect on
9ae3a8
    migration *downtime*. This is because, without this feature, all of the
9ae3a8
    memory will have already been registered already in advance during
9ae3a8
    the bulk round and does not need to be re-registered during the successive
9ae3a8
    iteration rounds.
9ae3a8
9ae3a8
    Reviewed-by: Juan Quintela <quintela@redhat.com>
9ae3a8
    Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
    Reviewed-by: Chegu Vinod <chegu_vinod@hp.com>
9ae3a8
    Reviewed-by: Eric Blake <eblake@redhat.com>
9ae3a8
    Tested-by: Chegu Vinod <chegu_vinod@hp.com>
9ae3a8
    Tested-by: Michael R. Hines <mrhines@us.ibm.com>
9ae3a8
    Signed-off-by: Michael R. Hines <mrhines@us.ibm.com>
9ae3a8
    Signed-off-by: Juan Quintela <quintela@redhat.com>
9ae3a8
---
9ae3a8
 include/migration/migration.h |    1 +
9ae3a8
 migration.c                   |    9 +++++++++
9ae3a8
 qapi-schema.json              |    7 ++++++-
9ae3a8
 3 files changed, 16 insertions(+), 1 deletions(-)
9ae3a8
9ae3a8
Signed-off-by: Michal Novotny <minovotn@redhat.com>
9ae3a8
---
9ae3a8
 include/migration/migration.h | 1 +
9ae3a8
 migration.c                   | 9 +++++++++
9ae3a8
 qapi-schema.json              | 7 ++++++-
9ae3a8
 3 files changed, 16 insertions(+), 1 deletion(-)
9ae3a8
9ae3a8
diff --git a/include/migration/migration.h b/include/migration/migration.h
9ae3a8
index 6455e36..701709a 100644
9ae3a8
--- a/include/migration/migration.h
9ae3a8
+++ b/include/migration/migration.h
9ae3a8
@@ -123,6 +123,7 @@ void migrate_add_blocker(Error *reason);
9ae3a8
  */
9ae3a8
 void migrate_del_blocker(Error *reason);
9ae3a8
 
9ae3a8
+bool migrate_rdma_pin_all(void);
9ae3a8
 bool migrate_zero_blocks(void);
9ae3a8
 
9ae3a8
 bool migrate_auto_converge(void);
9ae3a8
diff --git a/migration.c b/migration.c
9ae3a8
index f4d1e34..73a348f 100644
9ae3a8
--- a/migration.c
9ae3a8
+++ b/migration.c
9ae3a8
@@ -484,6 +484,15 @@ void qmp_migrate_set_downtime(double value, Error **errp)
9ae3a8
     max_downtime = (uint64_t)value;
9ae3a8
 }
9ae3a8
 
9ae3a8
+bool migrate_rdma_pin_all(void)
9ae3a8
+{
9ae3a8
+    MigrationState *s;
9ae3a8
+
9ae3a8
+    s = migrate_get_current();
9ae3a8
+
9ae3a8
+    return s->enabled_capabilities[MIGRATION_CAPABILITY_X_RDMA_PIN_ALL];
9ae3a8
+}
9ae3a8
+
9ae3a8
 bool migrate_auto_converge(void)
9ae3a8
 {
9ae3a8
     MigrationState *s;
9ae3a8
diff --git a/qapi-schema.json b/qapi-schema.json
9ae3a8
index 17df327..bf1fe68 100644
9ae3a8
--- a/qapi-schema.json
9ae3a8
+++ b/qapi-schema.json
9ae3a8
@@ -664,6 +664,11 @@
9ae3a8
 #          This feature allows us to minimize migration traffic for certain work
9ae3a8
 #          loads, by sending compressed difference of the pages
9ae3a8
 #
9ae3a8
+# @x-rdma-pin-all: Controls whether or not the entire VM memory footprint is
9ae3a8
+#          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
9ae3a8
+#          Disabled by default. Experimental: may (or may not) be renamed after
9ae3a8
+#          further testing is complete. (since 1.6)
9ae3a8
+#
9ae3a8
 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
9ae3a8
 #          to speed up convergence of RAM migration. (since 1.6)
9ae3a8
 #
9ae3a8
@@ -679,7 +684,7 @@
9ae3a8
 # Since: 1.2
9ae3a8
 ##
9ae3a8
 { 'enum': 'MigrationCapability',
9ae3a8
-  'data': ['xbzrle', 'auto-converge', 'zero-blocks'] }
9ae3a8
+  'data': ['xbzrle', 'x-rdma-pin-all', 'auto-converge', 'zero-blocks'] }
9ae3a8
 
9ae3a8
 ##
9ae3a8
 # @MigrationCapabilityStatus
9ae3a8
-- 
9ae3a8
1.7.11.7
9ae3a8