Patchwork [PULL,v3,3/7] rdma: introduce capability for chunk registration

login
register
mail settings
Submitter mrhines@linux.vnet.ibm.com
Date April 17, 2013, 4:20 a.m.
Message ID <1366172418-8729-4-git-send-email-mrhines@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/237143/
State New
Headers show

Comments

mrhines@linux.vnet.ibm.com - April 17, 2013, 4:20 a.m.
From: "Michael R. Hines" <mrhines@us.ibm.com>

This capability allows you to disable dynamic chunk registration
for better throughput on high-performance links.

It is enabled by default.

Signed-off-by: Michael R. Hines <mrhines@us.ibm.com>
---
 migration.c      |   10 ++++++++++
 qapi-schema.json |    2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)
Eric Blake - April 17, 2013, 3:44 p.m.
On 04/16/2013 10:20 PM, mrhines@linux.vnet.ibm.com wrote:
> From: "Michael R. Hines" <mrhines@us.ibm.com>
> 
> This capability allows you to disable dynamic chunk registration
> for better throughput on high-performance links.
> 
> It is enabled by default.
> 
> Signed-off-by: Michael R. Hines <mrhines@us.ibm.com>
> ---

> +++ b/qapi-schema.json
> @@ -602,7 +602,7 @@
>  # Since: 1.2

Normally, I'd ask that you document the option above; something like:

# @x-chunk-register-destination: do something (since 1.5)

>  ##
>  { 'enum': 'MigrationCapability',
> -  'data': ['xbzrle'] }
> +  'data': ['xbzrle', 'x-chunk-register-destination'] }

But given the x- prefix, which is already a designation that the option
is experimental and may be pulled, I can live without documentation here
(where JUST the RDMA documentation, which mentions this capability, is
sufficient).  Therefore:

Reviewed-by: Eric Blake <eblake@redhat.com>
mrhines@linux.vnet.ibm.com - April 17, 2013, 4 p.m.
On 04/17/2013 11:44 AM, Eric Blake wrote:
> On 04/16/2013 10:20 PM, mrhines@linux.vnet.ibm.com wrote:
>> From: "Michael R. Hines" <mrhines@us.ibm.com>
>>
>> This capability allows you to disable dynamic chunk registration
>> for better throughput on high-performance links.
>>
>> It is enabled by default.
>>
>> Signed-off-by: Michael R. Hines <mrhines@us.ibm.com>
>> ---
>> +++ b/qapi-schema.json
>> @@ -602,7 +602,7 @@
>>   # Since: 1.2
> Normally, I'd ask that you document the option above; something like:
>
> # @x-chunk-register-destination: do something (since 1.5)
>
>>   ##
>>   { 'enum': 'MigrationCapability',
>> -  'data': ['xbzrle'] }
>> +  'data': ['xbzrle', 'x-chunk-register-destination'] }
> But given the x- prefix, which is already a designation that the option
> is experimental and may be pulled, I can live without documentation here
> (where JUST the RDMA documentation, which mentions this capability, is
> sufficient).  Therefore:
>
> Reviewed-by: Eric Blake <eblake@redhat.com>
>

My apologies - I'm more than happy to add documentation.

Will include in next patch.

Patch

diff --git a/migration.c b/migration.c
index 3b4b467..5afd9b8 100644
--- a/migration.c
+++ b/migration.c
@@ -66,6 +66,7 @@  MigrationState *migrate_get_current(void)
         .state = MIG_STATE_SETUP,
         .bandwidth_limit = MAX_THROTTLE,
         .xbzrle_cache_size = DEFAULT_MIGRATE_CACHE_SIZE,
+        .enabled_capabilities[MIGRATION_CAPABILITY_X_CHUNK_REGISTER_DESTINATION] = true,
     };
 
     return &current_migration;
@@ -474,6 +475,15 @@  void qmp_migrate_set_downtime(double value, Error **errp)
     max_downtime = (uint64_t)value;
 }
 
+bool migrate_chunk_register_destination(void)
+{
+    MigrationState *s;
+
+    s = migrate_get_current();
+
+    return s->enabled_capabilities[MIGRATION_CAPABILITY_X_CHUNK_REGISTER_DESTINATION];
+}
+
 int migrate_use_xbzrle(void)
 {
     MigrationState *s;
diff --git a/qapi-schema.json b/qapi-schema.json
index 751d3c2..160168d 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -602,7 +602,7 @@ 
 # Since: 1.2
 ##
 { 'enum': 'MigrationCapability',
-  'data': ['xbzrle'] }
+  'data': ['xbzrle', 'x-chunk-register-destination'] }
 
 ##
 # @MigrationCapabilityStatus