cryptospore / rpms / qemu-kvm

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