rdma: migration support
PATCH v12 3/15 rdma: export yield_until_fd_readable()
In reply to [email protected]From: "Michael R. Hines" <[email protected]>
The RDMA event channel can be made non-blocking just like a TCP socket. Exporting this function allows us to yield so that the QEMU monitor remains available.
--- include/block/coroutine.h | 6 ++++++ qemu-coroutine-io.c | 23 +++++++++++++++++++++++ savevm.c | 28 ---------------------------- 3 files changed, 29 insertions(+), 28 deletions(-)
include/block/coroutine.h +6 -0
@@ -209,4 +209,10 @@ void qemu_co_rwlock_unlock(CoRwlock *lock);*/ void coroutine_fn co_sleep_ns(QEMUClock *clock, int64_t ns); +/** +* Yield until a file descriptor becomes readable +* +* Note that this function clobbers the handlers for the file descriptor. +*/ +void coroutine_fn yield_until_fd_readable(int fd);#endif /* QEMU_COROUTINE_H */
qemu-coroutine-io.c +23 -0
@@ -63,3 +63,26 @@ qemu_co_send_recv(int sockfd, void *buf, size_t bytes, bool do_send)struct iovec iov = { .iov_base = buf, .iov_len = bytes };return qemu_co_sendv_recvv (sockfd, &iov,1 ,0 , bytes, do_send); } + +typedef struct { +Coroutine *co; +int fd; +}FDYieldUntilData ; + +static void fd_coroutine_enter (void *opaque) +{ +FDYieldUntilData *data = opaque; +qemu_set_fd_handler (data->fd,NULL ,NULL ,NULL ); +qemu_coroutine_enter (data->co,NULL ); +} + +void coroutine_fn yield_until_fd_readable(int fd) +{ +FDYieldUntilData data; + +assert (qemu_in_coroutine ()); + data.co =qemu_coroutine_self (); + data.fd = fd; +qemu_set_fd_handler (fd, fd_coroutine_enter,NULL , &data); +qemu_coroutine_yield (); +}
savevm.c +0 -28
@@ -149,34 +149,6 @@ typedef struct QEMUFileSocketQEMUFile *file; } QEMUFileSocket; -typedef struct { -Coroutine *co; -int fd; -}FDYieldUntilData ; - -static void fd_coroutine_enter (void *opaque) -{ -FDYieldUntilData *data = opaque; -qemu_set_fd_handler (data->fd,NULL ,NULL ,NULL ); -qemu_coroutine_enter (data->co,NULL ); -} - -/** -* Yield until a file descriptor becomes readable -* -* Note that this function clobbers the handlers for the file descriptor. -*/ -static void coroutine_fn yield_until_fd_readable(int fd) -{ -FDYieldUntilData data; - -assert (qemu_in_coroutine ()); - data.co =qemu_coroutine_self (); - data.fd = fd; -qemu_set_fd_handler (fd, fd_coroutine_enter,NULL , &data); -qemu_coroutine_yield (); -} -static ssize_t socket_writev_buffer (void *opaque,struct iovec *iov,int iovcnt,int64_t pos) {
Signature · 1 line
1.7.10.4
PATCH v12 2/15 rdma: introduce qemu_update_position()
In reply to [email protected]From: "Michael R. Hines" <[email protected]>
RDMA writes happen asynchronously, and thus the performance accounting also needs to be able to occur asynchronously. This allows anybody to call into savevm.c to update both f->pos as well as into arch_init.c to update the acct_info structure with up-to-date values when the RDMA transfer actually completes.
--- arch_init.c | 12 ++++++++++++ include/migration/migration.h | 2 ++ include/migration/qemu-file.h | 1 + savevm.c | 5 +++++ 4 files changed, 20 insertions(+)
arch_init.c +12 -0
@@ -498,6 +498,18 @@ static int ram_save_block(QEMUFile *f, bool last_stage)static uint64_t bytes_transferred; +void acct_update_position (QEMUFile *f,size_t size,bool zero) +{ +uint64_t pages = size /TARGET_PAGE_SIZE ; +if (zero) { + acct_info.dup_pages += pages; + }else { + acct_info.norm_pages += pages; + bytes_transferred += size; +qemu_update_position (f, size); + } +} +static ram_addr_t ram_save_remaining (void ) {return migration_dirty_pages;
include/migration/migration.h +2 -0
@@ -92,6 +92,8 @@ uint64_t ram_bytes_remaining(void);uint64_t ram_bytes_transferred (void );uint64_t ram_bytes_total (void ); +void acct_update_position (QEMUFile *f,size_t size,bool zero); +extern SaveVMHandlers savevm_ram_handlers;uint64_t dup_mig_bytes_transferred (void );
include/migration/qemu-file.h +1 -0
@@ -93,6 +93,7 @@ void qemu_put_be32(QEMUFile *f, unsigned int v);void qemu_put_be64 (QEMUFile *f,uint64_t v);int qemu_get_buffer (QEMUFile *f,uint8_t *buf,int size);int qemu_get_byte (QEMUFile *f); +void qemu_update_position (QEMUFile *f,size_t size);static inline unsigned int qemu_get_ubyte (QEMUFile *f) {
savevm.c +5 -0
@@ -671,6 +671,11 @@ int qemu_get_fd(QEMUFile *f)return -1 ; } +void qemu_update_position (QEMUFile *f,size_t size) +{ + f->pos += size; +} +/** Closes the file * * Returns negative error value if any error happened on previous operations or
Signature · 1 line
1.7.10.4
PATCH v12 5/15 rdma: introduce qemu_file_mode_is_not_valid()
In reply to [email protected]From: "Michael R. Hines" <[email protected]>
QEMUFileRDMA also has read and write modes. This function is now shared to reduce code duplication.
--- include/migration/qemu-file.h | 1 + savevm.c | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-)
include/migration/qemu-file.h +1 -0
@@ -80,6 +80,7 @@ void qemu_put_byte(QEMUFile *f, int v);* The buffer should be available till it is sent asynchronously. */ void qemu_put_buffer_async (QEMUFile *f,const uint8_t *buf,int size); +bool qemu_file_mode_is_not_valid (const char *mode);static inline void qemu_put_ubyte (QEMUFile *f,unsigned int v) {
savevm.c +13 -7
@@ -449,14 +449,23 @@ static const QEMUFileOps socket_write_ops = { .close = socket_close }; -QEMUFile *qemu_fopen_socket (int fd,const char *mode) +bool qemu_file_mode_is_not_valid (const char *mode) { -QEMUFileSocket *s; -if (mode ==NULL || (mode[0 ] !='r' && mode[0 ] !='w' ) || mode[1 ] !='b' || mode[2 ] !=0 ) {fprintf (stderr,"qemu_fopen: Argument validity check failed\n" ); +return true; + } + +return false; +} + +QEMUFile *qemu_fopen_socket (int fd,const char *mode) +{ +QEMUFileSocket *s; + +if (qemu_file_mode_is_not_valid (mode)) {return NULL ; }
@@ -475,10 +484,7 @@ QEMUFile *qemu_fopen(const char *filename, const char *mode) {QEMUFileStdio *s; -if (mode ==NULL || - (mode[0 ] !='r' && mode[0 ] !='w' ) || - mode[1 ] !='b' || mode[2 ] !=0 ) { -fprintf (stderr,"qemu_fopen: Argument validity check failed\n" ); +if (qemu_file_mode_is_not_valid (mode)) {return NULL ; }
Signature · 1 line
1.7.10.4
PATCH v12 13/15 rdma: allow state transitions between other states besides ACTIVE
In reply to [email protected]From: "Michael R. Hines" <[email protected]>
This patch is in preparation for the next ones: Until now the MIG_STATE_SETUP state was not really a 'formal' state. It has been used as a 'zero' state and QEMU has been unconditionally transitioning into this state when the QMP migrate command was called. In preparation for timing this state, we have to make this state a a 'real' state which actually gets transitioned from later in the migration_thread() from SETUP => ACTIVE, rather than just automatically dropping into this state at the beginninig of the migration.
This means that the state transition function (migration_finish_set_state()) needs to be capable of transitioning from valid states _other_ than just MIG_STATE_ACTIVE.
The function is in fact already capable of doing that, but was not allowing the old state to be a parameter specified as an input.
This patch fixes that and only makes the transition if the current state matches the old state that the caller intended to transition from.
--- migration.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
migration.c +5 -5
@@ -295,9 +295,9 @@ static void migrate_fd_cleanup(void *opaque)notifier_list_notify (&migration_state_notifiers, s); } -static void migrate_finish_set_state (MigrationState *s,int new_state) +static void migrate_set_state (MigrationState *s,int old_state,int new_state) { -if (__sync_val_compare_and_swap (&s->state,MIG_STATE_ACTIVE , +if (__sync_val_compare_and_swap (&s->state, old_state, new_state) == new_state) {trace_migrate_set_state (new_state); }
@@ -316,7 +316,7 @@ static void migrate_fd_cancel(MigrationState *s) {DPRINTF ("cancelling migration\n" ); -migrate_finish_set_state (s,MIG_STATE_CANCELLED ); +migrate_set_state (s,MIG_STATE_ACTIVE ,MIG_STATE_CANCELLED ); }void add_migration_state_change_notifier (Notifier *notify)
@@ -546,14 +546,14 @@ static void *migration_thread(void *opaque)qemu_savevm_state_complete (s->file);qemu_mutex_unlock_iothread ();if (!qemu_file_get_error (s->file)) { -migrate_finish_set_state (s,MIG_STATE_COMPLETED ); +migrate_set_state (s,MIG_STATE_ACTIVE ,MIG_STATE_COMPLETED );break ; } } }if (qemu_file_get_error (s->file)) { -migrate_finish_set_state (s,MIG_STATE_ERROR ); +migrate_set_state (s,MIG_STATE_ACTIVE ,MIG_STATE_ERROR );break ; } current_time =qemu_get_clock_ms (rt_clock);
Signature · 1 line
1.7.10.4
PATCH v12 4/15 rdma: export throughput w/ MigrationStats QMP
In reply to [email protected]From: "Michael R. Hines" <[email protected]>
This exposes throughput (in megabits/sec) through QMP.
--- hmp.c | 2 ++ include/migration/migration.h | 1 + migration.c | 6 ++++++ qapi-schema.json | 5 ++++- 4 files changed, 13 insertions(+), 1 deletion(-)
hmp.c +2 -0
@@ -169,6 +169,8 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict)if (info->has_ram) {monitor_printf (mon,"transferred ram: %" PRIu64" kbytes\n" , info->ram->transferred >>10 ); +monitor_printf (mon,"throughput: %0.2f mbps\n" , + info->ram->mbps);monitor_printf (mon,"remaining ram: %" PRIu64" kbytes\n" , info->ram->remaining >>10 ); monitor_printf(mon, "total ram: %" PRIu64 " kbytes\n",
include/migration/migration.h +1 -0
@@ -40,6 +40,7 @@ struct MigrationStateint state;MigrationParams params; +double mbps;int64_t total_time;int64_t downtime;int64_t expected_downtime;
migration.c +6 -0
@@ -66,6 +66,7 @@ MigrationState *migrate_get_current(void) .state = MIG_STATE_SETUP, .bandwidth_limit = MAX_THROTTLE, .xbzrle_cache_size = DEFAULT_MIGRATE_CACHE_SIZE, + .mbps = -1, };return ¤t_migration;
@@ -201,6 +202,7 @@ MigrationInfo *qmp_query_migrate(Error **errp) info->ram->normal =norm_mig_pages_transferred (); info->ram->normal_bytes =norm_mig_bytes_transferred (); info->ram->dirty_pages_rate = s->dirty_pages_rate; + info->ram->mbps = s->mbps;if (blk_mig_active ()) { info->has_disk = true;
@@ -230,6 +232,7 @@ MigrationInfo *qmp_query_migrate(Error **errp) info->ram->skipped =skipped_mig_pages_transferred (); info->ram->normal =norm_mig_pages_transferred (); info->ram->normal_bytes =norm_mig_bytes_transferred (); + info->ram->mbps = s->mbps;break ;case MIG_STATE_ERROR : info->has_status = true;
@@ -543,6 +546,9 @@ static void *migration_thread(void *opaque)double bandwidth = transferred_bytes / time_spent; max_size = bandwidth *migrate_max_downtime () /1000000 ; + s->mbps = time_spent ? (((double ) transferred_bytes *8.0 ) / + ((double ) time_spent /1000.0 )) /1000.0 /1000.0 :-1 ; +DPRINTF ("transferred %" PRIu64" time_spent %" PRIu64" bandwidth %g max_size %" PRId64"\n" , transferred_bytes, time_spent, bandwidth, max_size);
qapi-schema.json +4 -1
@@ -513,12 +513,15 @@ # @dirty-pages-rate: number of pages dirtied by second by the # guest (since 1.3) # +# @mbps: throughput in megabits/sec. (since 1.6) +# # Since: 0.14.0 ## { 'type': 'MigrationStats', 'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' , 'duplicate': 'int', 'skipped': 'int', 'normal': 'int', - 'normal-bytes': 'int', 'dirty-pages-rate' : 'int' } } + 'normal-bytes': 'int', 'dirty-pages-rate' : 'int', + 'mbps' : 'number' } } ## # @XBZRLECacheStats
Signature · 1 line
1.7.10.4
PATCH v12 9/15 rdma: new QEMUFileOps hooks
In reply to [email protected]From: "Michael R. Hines" <[email protected]>
These are the prototypes and implementation of new hooks that RDMA takes advantage of to perform dynamic page registration.
An optional hook is also introduced for a custom function to be able to override the default save_page function.
Also included are the prototypes and accessor methods used by arch_init.c which invoke funtions inside savevm.c to call out to the hooks that may or may not have been overridden inside of QEMUFileOps.
--- include/migration/migration.h | 20 ++++++++++++++ include/migration/qemu-file.h | 29 ++++++++++++++++++++ savevm.c | 59 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+)
include/migration/migration.h +20 -0
@@ -21,6 +21,7 @@#include "qapi/error.h" #include "migration/vmstate.h" #include "qapi-types.h" +#include "exec/cpu-common.h" struct MigrationParams {bool blk;
@@ -132,4 +133,23 @@ int migrate_use_xbzrle(void);int64_t migrate_xbzrle_cache_size (void );int64_t xbzrle_cache_resize (int64_t new_size); + +void ram_control_before_iterate (QEMUFile *f,uint64_t flags); +void ram_control_after_iterate (QEMUFile *f,uint64_t flags); +void ram_control_load_hook (QEMUFile *f,uint64_t flags); + +/* Whenever this is found in the data stream, the flags +* will be passed to ram_control_load_hook in the incoming-migration +* side. This lets before_ram_iterate/after_ram_iterate add +* transport-specific sections to the RAM migration data. +*/ +#define RAM_SAVE_FLAG_HOOK 0x80 + +#define RAM_SAVE_CONTROL_NOT_SUPP -1000 +#define RAM_SAVE_CONTROL_DELAYED -2000 + +size_t ram_control_save_page (QEMUFile *f,ram_addr_t block_offset, +ram_addr_t offset,size_t size, +int *bytes_sent); +#endif
include/migration/qemu-file.h +29 -0
@@ -23,6 +23,7 @@*/ #ifndef QEMU_FILE_H #define QEMU_FILE_H 1 +#include "exec/cpu-common.h" /* This function writes a chunk of data to a file at the given position. * The pos argument can be ignored if the file is only being used for
@@ -57,12 +58,40 @@ typedef int (QEMUFileGetFD)(void *opaque);typedef ssize_t (QEMUFileWritevBufferFunc )(void *opaque,struct iovec *iov,int iovcnt,int64_t pos); +/* +* This function provides hooks around different +* stages of RAM migration. +*/ +typedef int (QEMURamHookFunc )(QEMUFile *f,void *opaque,uint64_t flags); + +/* +* Constants used by ram_control_* hooks +*/ +#define RAM_CONTROL_SETUP 0 +#define RAM_CONTROL_ROUND 1 +#define RAM_CONTROL_HOOK 2 +#define RAM_CONTROL_FINISH 3 + +/* +* This function allows override of where the RAM page +* is saved (such as RDMA, for example.) +*/ +typedef size_t (QEMURamSaveFunc )(QEMUFile *f,void *opaque, +ram_addr_t block_offset, +ram_addr_t offset, +size_t size, +int *bytes_sent); +typedef struct QEMUFileOps {QEMUFilePutBufferFunc *put_buffer;QEMUFileGetBufferFunc *get_buffer;QEMUFileCloseFunc *close;QEMUFileGetFD *get_fd;QEMUFileWritevBufferFunc *writev_buffer; +QEMURamHookFunc *before_ram_iterate; +QEMURamHookFunc *after_ram_iterate; +QEMURamHookFunc *hook_ram_load; +QEMURamSaveFunc *save_page; }QEMUFileOps ;QEMUFile *qemu_fopen_ops (void *opaque,const QEMUFileOps *ops);
savevm.c +59 -0
65 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH v12 10/15 rdma: introduce capability x-rdma-pin-all
In reply to [email protected]From: "Michael R. Hines" <[email protected]>
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-rdma-pin-all disabled total time: approximately 7.5 seconds @ 9.5 Gbps
2. x-rdma-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.
--- include/migration/migration.h | 2 ++ migration.c | 9 +++++++++ qapi-schema.json | 7 ++++++- 3 files changed, 17 insertions(+), 1 deletion(-)
include/migration/migration.h +2 -0
@@ -125,6 +125,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);
migration.c +9 -0
@@ -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;
qapi-schema.json +6 -1
@@ -608,10 +608,15 @@ # This feature allows us to minimize migration traffic for certain work # loads, by sending compressed difference of the pages # +# @x-rdma-pin-all: Controls whether or not the entire VM memory footprint is +# mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage. +# Disabled by default. Experimental: may (or may not) be renamed after +# further testing is complete. (since 1.6) +# # Since: 1.2 ## { 'enum': 'MigrationCapability', - 'data': ['xbzrle'] } + 'data': ['xbzrle', 'x-rdma-pin-all'] } ## # @MigrationCapabilityStatus
Signature · 1 line
1.7.10.4
PATCH v12 12/15 rdma: send pc.ram
In reply to [email protected]From: "Michael R. Hines" <[email protected]>
This takes advantages of the previous patches:
1. use the new QEMUFileOps hook 'save_page'
2. call out to the right accessor methods to invoke the iteration hooks defined in QEMUFileOps
--- arch_init.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-)
arch_init.c +32 -1
@@ -115,6 +115,7 @@ const uint32_t arch_type = QEMU_ARCH;#define RAM_SAVE_FLAG_EOS 0x10#define RAM_SAVE_FLAG_CONTINUE 0x20#define RAM_SAVE_FLAG_XBZRLE 0x40 +/* 0x80 is reserved in migration.h start with 0x100 next */ static struct defconfig_file {
@@ -447,6 +448,7 @@ static int ram_save_block(QEMUFile *f, bool last_stage) ram_bulk_stage = false; } }else { +int ret;uint8_t *p;int cont = (block == last_sent_block) ?RAM_SAVE_FLAG_CONTINUE :0 ;
@@ -455,7 +457,18 @@ static int ram_save_block(QEMUFile *f, bool last_stage)/* In doubt sent page as normal */ bytes_sent =-1 ; -if (is_zero_page (p)) { + ret =ram_control_save_page (f, block->offset, + offset,TARGET_PAGE_SIZE , &bytes_sent); + +if (ret !=RAM_SAVE_CONTROL_NOT_SUPP ) { +if (ret !=RAM_SAVE_CONTROL_DELAYED ) { +if (bytes_sent >0 ) { + acct_info.norm_pages++; + }else if (bytes_sent ==0 ) { + acct_info.dup_pages++; + } + } + }else if (is_zero_page (p)) { acct_info.dup_pages++;if (!ram_bulk_stage) { bytes_sent = save_block_hdr(f, block, offset, cont,
@@ -610,6 +623,10 @@ static int ram_save_setup(QEMUFile *f, void *opaque) }qemu_mutex_unlock_ramlist (); + +ram_control_before_iterate (f,RAM_CONTROL_SETUP ); +ram_control_after_iterate (f,RAM_CONTROL_SETUP ); +qemu_put_be64 (f,RAM_SAVE_FLAG_EOS );return 0 ;
@@ -628,6 +645,8 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)reset_ram_globals (); } +ram_control_before_iterate (f,RAM_CONTROL_ROUND ); + t0 =qemu_get_clock_ns (rt_clock); i =0 ;while ((ret =qemu_file_rate_limit (f)) ==0 ) {
@@ -658,6 +677,12 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)qemu_mutex_unlock_ramlist (); +/* +* Must occur before EOS (or any QEMUFile operation) +* because of RDMA protocol. +*/ +ram_control_after_iterate (f,RAM_CONTROL_ROUND ); +if (ret <0 ) { bytes_transferred += total_sent;return ret;
@@ -675,6 +700,8 @@ static int ram_save_complete(QEMUFile *f, void *opaque)qemu_mutex_lock_ramlist ();migration_bitmap_sync (); +ram_control_before_iterate (f,RAM_CONTROL_FINISH ); +/* try transferring iterative blocks of memory */ /* flush all remaining blocks regardless of rate limiting */
@@ -688,6 +715,8 @@ static int ram_save_complete(QEMUFile *f, void *opaque) } bytes_transferred += bytes_sent; } + +ram_control_after_iterate (f,RAM_CONTROL_FINISH );migration_end ();qemu_mutex_unlock_ramlist ();
@@ -884,6 +913,8 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id) ret = -EINVAL ; goto done; } + }else if (flags &RAM_SAVE_FLAG_HOOK ) { +ram_control_load_hook (f, flags); } error =qemu_file_get_error (f);if (error) {
Signature · 1 line
1.7.10.4
v12 cover rdma: migration support
From: "Michael R. Hines" <[email protected]>
Changes since v11:
- Minor state transition fix
- Fixed localhost migration
- Fixed 0.0.0.0 migration
- Drop invalid hunk
- Updated tags
Michael R. Hines (15):
rdma: add documentation
rdma: introduce qemu_update_position()
rdma: export yield_until_fd_readable()
rdma: export throughput w/ MigrationStats QMP
rdma: introduce qemu_file_mode_is_not_valid()
rdma: export qemu_fflush()
rdma: introduce ram_handle_compressed()
rdma: introduce qemu_ram_foreach_block()
rdma: new QEMUFileOps hooks
rdma: introduce capability x-rdma-pin-all
rdma: core logic
rdma: send pc.ram
rdma: allow state transitions between other states besides ACTIVE
rdma: introduce MIG_STATE_NONE and change MIG_STATE_SETUP state
transition
rdma: account for the time spent in MIG_STATE_SETUP through QMP
Makefile.objs | 1 + arch_init.c | 69 +- configure | 29 + docs/rdma.txt | 415 ++++++ exec.c | 9 + hmp.c | 6 + include/block/coroutine.h | 6 + include/exec/cpu-common.h | 5 + include/migration/migration.h | 32 + include/migration/qemu-file.h | 32 + migration-rdma.c | 2789 +++++++++++++++++++++++++++++++++++++++++ migration.c | 63 +- qapi-schema.json | 21 +- qemu-coroutine-io.c | 23 + savevm.c | 114 +- 15 files changed, 3554 insertions(+), 60 deletions(-) create mode 100644 docs/rdma.txt create mode 100644 migration-rdma.c
Signature · 1 line
1.7.10.4
PATCH v12 8/15 rdma: introduce qemu_ram_foreach_block()
From: "Michael R. Hines" <[email protected]>
This is used during RDMA initialization in order to transmit a description of all the RAM blocks to the peer for later dynamic chunk registration purposes.
--- exec.c | 9 +++++++++ include/exec/cpu-common.h | 5 +++++ 2 files changed, 14 insertions(+)
exec.c +9 -0
@@ -2630,3 +2630,12 @@ bool cpu_physical_memory_is_io(hwaddr phys_addr) memory_region_is_romd(mr)); }#endif + +void qemu_ram_foreach_block (RAMBlockIterFunc func,void *opaque) +{ +RAMBlock *block; + + QTAILQ_FOREACH(block, &ram_list.blocks, next) { +func (block->host, block->offset, block->length, opaque); + } +}
include/exec/cpu-common.h +5 -0
@@ -113,6 +113,11 @@ void cpu_physical_memory_write_rom(hwaddr addr,extern struct MemoryRegion io_mem_rom;extern struct MemoryRegion io_mem_notdirty; +typedef void (RAMBlockIterFunc )(void *host_addr, +ram_addr_t offset,ram_addr_t length,void *opaque); + +void qemu_ram_foreach_block (RAMBlockIterFunc func,void *opaque); +#endif #endif /* !CPU_COMMON_H */
Signature · 1 line
1.7.10.4
PATCH v12 1/15 rdma: add documentation
In reply to [email protected]From: "Michael R. Hines" <[email protected]>
docs/rdma.txt contains full documentation, wiki links, github url and contact information.
--- docs/rdma.txt | 415 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 415 insertions(+) create mode 100644 docs/rdma.txt
docs/rdma.txt new file +415 -0
@@ -0,0 +1,415 @@ +(RDMA: Remote Direct Memory Access) +RDMA Live Migration Specification, Version # 1 +============================================== +Wiki: http://wiki.qemu.org/Features/RDMALiveMigration +Github: [email protected]:hinesmr/qemu.git, 'rdma' branch + +Copyright (C) 2013 Michael R. Hines <[email protected]> + +An *exhaustive* paper (2010) shows additional performance details +linked on the QEMU wiki above. + +Contents: +========= +* Introduction +* Before running +* Running +* Performance +* RDMA Migration Protocol Description +* Versioning and Capabilities +* QEMUFileRDMA Interface +* Migration of pc.ram +* Error handling +* TODO + +Introduction: +============= + +RDMA helps make your migration more deterministic under heavy load because +of the significantly lower latency and higher throughput over TCP/IP. This is +because the RDMA I/O architecture reduces the number of interrupts and +data copies by bypassing the host networking stack. In particular, a TCP-based +migration, under certain types of memory-bound workloads, may take a more +unpredicatable amount of time to complete the migration if the amount of +memory tracked during each live migration iteration round cannot keep pace +with the rate of dirty memory produced by the workload. + +RDMA currently comes in two flavors: both Ethernet based (RoCE, or RDMA +over Convered Ethernet) as well as Infiniband-based. This implementation of +migration using RDMA is capable of using both technologies because of +the use of the OpenFabrics OFED software stack that abstracts out the +programming model irrespective of the underlying hardware. + +Refer to openfabrics.org or your respective RDMA hardware vendor for +an understanding on how to verify that you have the OFED software stack +installed in your environment. You should be able to successfully link +against the "librdmacm" and "libibverbs" libraries and development headers +for a working build of QEMU to run successfully using RDMA Migration. + +BEFORE RUNNING: +=============== + +Use of RDMA during migration requires pinning and registering memory +with the hardware. This means that memory must be physically resident +before the hardware can transmit that memory to another machine. +If this is not acceptable for your application or product, then the use +of RDMA migration may in fact be harmful to co-located VMs or other +software on the machine if there is not sufficient memory available to +relocate the entire footprint of the virtual machine. If so, then the +use of RDMA is discouraged and it is recommended to use standard TCP migration. + +Experimental: Next, decide if you want dynamic page registration. +For example, if you have an 8GB RAM virtual machine, but only 1GB +is in active use, then enabling this feature will cause all 8GB to +be pinned and resident in memory. This feature mostly affects the +bulk-phase round of the migration and can be enabled for extremely +high-performance RDMA hardware using the following command: + +QEMU Monitor Command: +$ migrate_set_capability x-rdma-pin-all on # disabled by default + +Performing this action will cause all 8GB to be pinned, so if that's +not what you want, then please ignore this step altogether. + +On the other hand, this will also significantly speed up the bulk round +of the migration, which can greatly reduce the "total" time of your migration. +Example performance of this using an idle VM in the previous example +can be found in the "Performance" section. + +Note: for very large virtual machines (hundreds of GBs), pinning all +*all* of the memory of your virtual machine in the kernel is very expensive +may extend the initial bulk iteration time by many seconds, +and thus extending the total migration time. However, this will not +affect the determinism or predictability of your migration you will +still gain from the benefits of advanced pinning with RDMA. + +RUNNING: +======== + +First, set the migration speed to match your hardware's capabilities: + +QEMU Monitor Command: +$ migrate_set_speed 40g # or whatever is the MAX of your RDMA device + +Next, on the destination machine, add the following to the QEMU command line: + +qemu ..... -incoming x-rdma:host:port + +Finally, perform the actual migration on the source machine: + +QEMU Monitor Command: +$ migrate -d x-rdma:host:port + +PERFORMANCE +=========== + +Here is a brief summary of total migration time and downtime using RDMA: +Using a 40gbps infiniband link performing a worst-case stress test, +using an 8GB RAM virtual machine: + +Using the following command: +$ apt-get install stress +$ stress --vm-bytes 7500M --vm 1 --vm-keep + +1. Migration throughput: 26 gigabits/second. +2. Downtime (stop time) varies between 15 and 100 milliseconds. + +EFFECTS of memory registration on bulk phase round: + +For example, in the same 8GB RAM example with all 8GB of memory in +active use and the VM itself is completely idle using the same 40 gbps +infiniband link: + +1. x-rdma-pin-all disabled total time: approximately 7.5 seconds @ 9.5 Gbps +2. x-rdma-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. + +RDMA Protocol Description: +========================== + +Migration with RDMA is separated into two parts: + +1. The transmission of the pages using RDMA +2. Everything else (a control channel is introduced) + +"Everything else" is transmitted using a formal +protocol now, consisting of infiniband SEND messages. + +An infiniband SEND message is the standard ibverbs +message used by applications of infiniband hardware. +The only difference between a SEND message and an RDMA +message is that SEND messages cause notifications +to be posted to the completion queue (CQ) on the +infiniband receiver side, whereas RDMA messages (used +for pc.ram) do not (to behave like an actual DMA). + +Messages in infiniband require two things: + +1. registration of the memory that will be transmitted +2. (SEND only) work requests to be posted on both + sides of the network before the actual transmission + can occur. + +RDMA messages are much easier to deal with. Once the memory +on the receiver side is registered and pinned, we're +basically done. All that is required is for the sender +side to start dumping bytes onto the link. + +(Memory is not released from pinning until the migration +completes, given that RDMA migrations are very fast.) + +SEND messages require more coordination because the +receiver must have reserved space (using a receive +work request) on the receive queue (RQ) before QEMUFileRDMA +can start using them to carry all the bytes as +a control transport for migration of device state. + +To begin the migration, the initial connection setup is +as follows (migration-rdma.c): + +1. Receiver and Sender are started (command line or libvirt): +2. Both sides post two RQ work requests +3. Receiver does listen() +4. Sender does connect() +5. Receiver accept() +6. Check versioning and capabilities (described later) + +At this point, we define a control channel on top of SEND messages +which is described by a formal protocol. Each SEND message has a +header portion and a data portion (but together are transmitted +as a single SEND message). + +Header: + * Length (of the data portion, uint32, network byte order) + * Type (what command to perform, uint32, network byte order) + * Repeat (Number of commands in data portion, same type only) + +The 'Repeat' field is here to support future multiple page registrations +in a single message without any need to change the protocol itself +so that the protocol is compatible against multiple versions of QEMU. +Version #1 requires that all server implementations of the protocol must +check this field and register all requests found in the array of commands located +in the data portion and return an equal number of results in the response. +The maximum number of repeats is hard-coded to 4096. This is a conservative +limit based on the maximum size of a SEND message along with emperical +observations on the maximum future benefit of simultaneous page registrations. + +The 'type' field has 10 different command values: + 1. Unused + 2. Error (sent to the source during bad things) + 3. Ready (control-channel is available) + 4. QEMU File (for sending non-live device state) + 5. RAM Blocks request (used right after connection setup) + 6. RAM Blocks result (used right after connection setup) + 7. Compress page (zap zero page and skip registration) + 8. Register request (dynamic chunk registration) + 9. Register result ('rkey' to be used by sender) + 10. Register finished (registration for current iteration finished) + +A single control message, as hinted above, can contain within the data +portion an array of many commands of the same type. If there is more than +one command, then the 'repeat' field will be greater than 1. + +After connection setup, message 5 & 6 are used to exchange ram block +information and optionally pin all the memory if requested by the user. + +After ram block exchange is completed, we have two protocol-level +functions, responsible for communicating control-channel commands +using the above list of values: + +Logically: + +qemu_rdma_exchange_recv(header, expected command type) + +1. We transmit a READY command to let the sender know that + we are *ready* to receive some data bytes on the control channel. +2. Before attempting to receive the expected command, we post another + RQ work request to replace the one we just used up. +3. Block on a CQ event channel and wait for the SEND to arrive. +4. When the send arrives, librdmacm will unblock us. +5. Verify that the command-type and version received matches the one we expected. + +qemu_rdma_exchange_send(header, data, optional response header & data): + +1. Block on the CQ event channel waiting for a READY command + from the receiver to tell us that the receiver + is *ready* for us to transmit some new bytes. +2. Optionally: if we are expecting a response from the command + (that we have no yet transmitted), let's post an RQ + work request to receive that data a few moments later. +3. When the READY arrives, librdmacm will + unblock us and we immediately post a RQ work request + to replace the one we just used up. +4. Now, we can actually post the work request to SEND + the requested command type of the header we were asked for. +5. Optionally, if we are expecting a response (as before), + we block again and wait for that response using the additional + work request we previously posted. (This is used to carry + 'Register result' commands #6 back to the sender which + hold the rkey need to perform RDMA. Note that the virtual address + corresponding to this rkey was already exchanged at the beginning + of the connection (described below). + +All of the remaining command types (not including 'ready') +described above all use the aformentioned two functions to do the hard work: + +1. After connection setup, RAMBlock information is exchanged using + this protocol before the actual migration begins. This information includes + a description of each RAMBlock on the server side as well as the virtual addresses + and lengths of each RAMBlock. This is used by the client to determine the + start and stop locations of chunks and how to register them dynamically + before performing the RDMA operations. +2. During runtime, once a 'chunk' becomes full of pages ready to + be sent with RDMA, the registration commands are used to ask the + other side to register the memory for this chunk and respond + with the result (rkey) of the registration. +3. Also, the QEMUFile interfaces also call these functions (described below) + when transmitting non-live state, such as devices or to send + its own protocol information during the migration process. +4. Finally, zero pages are only checked if a page has not yet been registered + using chunk registration (or not checked at all and unconditionally + written if chunk registration is disabled. This is accomplished using + the "Compress" command listed above. If the page *has* been registered + then we check the entire chunk for zero. Only if the entire chunk is + zero, then we send a compress command to zap the page on the other side. + +Versioning and Capabilities +=========================== +Current version of the protocol is version #1. + +The same version applies to both for protocol traffic and capabilities +negotiation. (i.e. There is only one version number that is referred to +by all communication). + +librdmacm provides the user with a 'private data' area to be exchanged +at connection-setup time before any infiniband traffic is generated. + +Header: + * Version (protocol version validated before send/recv occurs), uint32, network byte order + * Flags (bitwise OR of each capability), uint32, network byte order + +There is no data portion of this header right now, so there is +no length field. The maximum size of the 'private data' section +is only 192 bytes per the Infiniband specification, so it's not +very useful for data anyway. This structure needs to remain small. + +This private data area is a convenient place to check for protocol +versioning because the user does not need to register memory to +transmit a few bytes of version information. + +This is also a convenient place to negotiate capabilities +(like dynamic page registration). + +If the version is invalid, we throw an error. + +If the version is new, we only negotiate the capabilities that the +requested version is able to perform and ignore the rest. + +Currently there is only *one* capability in Version #1: dynamic page registration + +Finally: Negotiation happens with the Flags field: If the primary-VM +sets a flag, but the destination does not support this capability, it +will return a zero-bit for that flag and the primary-VM will understand +that as not being an available capability and will thus disable that +capability on the primary-VM side. + +QEMUFileRDMA Interface: +======================= + +QEMUFileRDMA introduces a couple of new functions: + +1. qemu_rdma_get_buffer() (QEMUFileOps rdma_read_ops) +2. qemu_rdma_put_buffer() (QEMUFileOps rdma_write_ops) + +These two functions are very short and simply use the protocol +describe above to deliver bytes without changing the upper-level +users of QEMUFile that depend on a bytestream abstraction. + +Finally, how do we handoff the actual bytes to get_buffer()? + +Again, because we're trying to "fake" a bytestream abstraction +using an analogy not unlike individual UDP frames, we have +to hold on to the bytes received from control-channel's SEND +messages in memory. + +Each time we receive a complete "QEMU File" control-channel +message, the bytes from SEND are copied into a small local holding area. + +Then, we return the number of bytes requested by get_buffer() +and leave the remaining bytes in the holding area until get_buffer() +comes around for another pass. + +If the buffer is empty, then we follow the same steps +listed above and issue another "QEMU File" protocol command, +asking for a new SEND message to re-fill the buffer. + +Migration of pc.ram: +==================== + +At the beginning of the migration, (migration-rdma.c), +the sender and the receiver populate the list of RAMBlocks +to be registered with each other into a structure. +Then, using the aforementioned protocol, they exchange a +description of these blocks with each other, to be used later +during the iteration of main memory. This description includes +a list of all the RAMBlocks, their offsets and lengths, virtual +addresses and possibly includes pre-registered RDMA keys in case dynamic +page registration was disabled on the server-side, otherwise not. + +Main memory is not migrated with the aforementioned protocol, +but is instead migrated with normal RDMA Write operations. + +Pages are migrated in "chunks" (hard-coded to 1 Megabyte right now). +Chunk size is not dynamic, but it could be in a future implementation. +There's nothing to indicate that this is useful right now. + +When a chunk is full (or a flush() occurs), the memory backed by +the chunk is registered with librdmacm is pinned in memory on +both sides using the aforementioned protocol. +After pinning, an RDMA Write is generated and transmitted +for the entire chunk. + +Chunks are also transmitted in batches: This means that we +do not request that the hardware signal the completion queue +for the completion of *every* chunk. The current batch size +is about 64 chunks (corresponding to 64 MB of memory). +Only the last chunk in a batch must be signaled. +This helps keep everything as asynchronous as possible +and helps keep the hardware busy performing RDMA operations. + +Error-handling: +=============== + +Infiniband has what is called a "Reliable, Connected" +link (one of 4 choices). This is the mode in which +we use for RDMA migration. + +If a *single* message fails, +the decision is to abort the migration entirely and +cleanup all the RDMA descriptors and unregister all +the memory. + +After cleanup, the Virtual Machine is returned to normal +operation the same way that would happen if the TCP +socket is broken during a non-RDMA based migration. + +TODO: +===== +1. 'migrate x-rdma:host:port' and '-incoming x-rdma' options will be + renamed to 'rdma' after the experimental phase of this work has + completed upstream. +2. Currently, 'ulimit -l' mlock() limits as well as cgroups swap limits + are not compatible with infinband memory pinning and will result in + an aborted migration (but with the source VM left unaffected). +3. Use of the recent /proc/<pid>/pagemap would likely speed up + the use of KSM and ballooning while using RDMA. +4. Also, some form of balloon-device usage tracking would also + help alleviate some issues.
Signature · 1 line
1.7.10.4
PATCH v12 6/15 rdma: export qemu_fflush()
In reply to [email protected]From: "Michael R. Hines" <[email protected]>
RDMA uses this to flush the control channel before sending its own message to handle page registrations.
--- include/migration/qemu-file.h | 1 + savevm.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
include/migration/qemu-file.h +1 -0
@@ -112,6 +112,7 @@ void qemu_file_reset_rate_limit(QEMUFile *f);void qemu_file_set_rate_limit (QEMUFile *f,int64_t new_rate);int64_t qemu_file_get_rate_limit (QEMUFile *f);int qemu_file_get_error (QEMUFile *f); +void qemu_fflush (QEMUFile *f);static inline void qemu_put_be64s (QEMUFile *f,const uint64_t *pv) {
savevm.c +1 -1
@@ -589,7 +589,7 @@ static inline bool qemu_file_is_writable(QEMUFile *f)* If there is writev_buffer QEMUFileOps it uses it otherwise uses * put_buffer ops. */ -static void qemu_fflush (QEMUFile *f) +void qemu_fflush (QEMUFile *f) {ssize_t ret =0 ;
Signature · 1 line
1.7.10.4
PATCH v12 14/15 rdma: introduce MIG_STATE_NONE and change MIG_STATE_SETUP state transition
In reply to [email protected]From: "Michael R. Hines" <[email protected]>
As described in the previous patch, until now, the MIG_STATE_SETUP state was not really a 'formal' state. It has been used as a 'zero' state (what we're calling 'NONE' here) and QEMU has been unconditionally transitioning into this state when the QMP migration command was called. Instead we want to introduce MIG_STATE_NONE, which is our starting state in the state machine, and then immediately transition into the MIG_STATE_SETUP state when the QMP migrate command is issued.
In order to do this, we must delay the transition into MIG_STATE_ACTIVE until later in the migration_thread(). This is done to be able to timestamp the amount of time spent in the SETUP state for proper accounting to the user during an RDMA migration.
Furthermore, the management software, until now, has never been aware of the existence of the SETUP state whatsoever. This must change, because, timing of this state implies that the state actually exists.
These two patches cannot be separated because the 'query_migrate' QMP switch statement needs to know how to handle this new state transition.
--- migration.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
migration.c +15 -8
@@ -36,7 +36,8 @@#endif enum { -MIG_STATE_ERROR , +MIG_STATE_ERROR =-1 , +MIG_STATE_NONE ,MIG_STATE_SETUP ,MIG_STATE_CANCELLED ,MIG_STATE_ACTIVE ,
@@ -63,7 +64,7 @@ static NotifierList migration_state_notifiers =MigrationState *migrate_get_current (void ) {static MigrationState current_migration = { - .state =MIG_STATE_SETUP , + .state =MIG_STATE_NONE , .bandwidth_limit =MAX_THROTTLE , .xbzrle_cache_size =DEFAULT_MIGRATE_CACHE_SIZE , .mbps =-1 ,
@@ -184,9 +185,13 @@ MigrationInfo *qmp_query_migrate(Error **errp)MigrationState *s =migrate_get_current ();switch (s->state) { -case MIG_STATE_SETUP : +case MIG_STATE_NONE :/* no migration has happened ever */ break ; +case MIG_STATE_SETUP : + info->has_status = true; + info->status =g_strdup ("setup" ); +break ;case MIG_STATE_ACTIVE : info->has_status = true; info->status =g_strdup ("active" );
@@ -257,7 +262,7 @@ void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params,MigrationState *s =migrate_get_current ();MigrationCapabilityStatusList *cap; -if (s->state ==MIG_STATE_ACTIVE ) { +if (s->state ==MIG_STATE_ACTIVE || s->state ==MIG_STATE_SETUP ) {error_set (errp,QERR_MIGRATION_ACTIVE );return ; }
@@ -316,7 +321,7 @@ static void migrate_fd_cancel(MigrationState *s) {DPRINTF ("cancelling migration\n" ); -migrate_set_state (s,MIG_STATE_ACTIVE ,MIG_STATE_CANCELLED ); +migrate_set_state (s, s->state,MIG_STATE_CANCELLED ); }void add_migration_state_change_notifier (Notifier *notify)
@@ -393,7 +398,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, params.blk = blk; params.shared = inc; -if (s->state ==MIG_STATE_ACTIVE ) { +if (s->state ==MIG_STATE_ACTIVE || s->state ==MIG_STATE_SETUP ) {error_set (errp,QERR_MIGRATION_ACTIVE );return ; }
@@ -525,6 +530,8 @@ static void *migration_thread(void *opaque)DPRINTF ("beginning savevm\n" );qemu_savevm_state_begin (s->file, &s->params); +migrate_set_state (s,MIG_STATE_SETUP ,MIG_STATE_ACTIVE ); +while (s->state ==MIG_STATE_ACTIVE ) {int64_t current_time;uint64_t pending_size;
@@ -604,8 +611,8 @@ static void *migration_thread(void *opaque)void migrate_fd_connect (MigrationState *s) { - s->state =MIG_STATE_ACTIVE ; -trace_migrate_set_state (MIG_STATE_ACTIVE ); + s->state =MIG_STATE_SETUP ; +trace_migrate_set_state (MIG_STATE_SETUP );/* This is a best 1st approximation. ns to ms */ s->expected_downtime = max_downtime/1000000 ;
Signature · 1 line
1.7.10.4
PATCH v12 11/15 rdma: core logic
In reply to [email protected]From: "Michael R. Hines" <[email protected]>
Code that does need to be visible is kept well contained inside this file and this is the only new additional file to the entire patch.
This file includes the entire protocol and interfaces required to perform RDMA migration.
Also, the configure and Makefile modifications to link this file are included.
Full documentation is in docs/rdma.txt
--- Makefile.objs | 1 + configure | 29 + include/migration/migration.h | 4 + migration-rdma.c | 2789 +++++++++++++++++++++++++++++++++++++++++ migration.c | 8 + 5 files changed, 2831 insertions(+) create mode 100644 migration-rdma.c
Makefile.objs +1 -0
@@ -51,6 +51,7 @@ common-obj-$(CONFIG_POSIX) += os-posix.o common-obj-$(CONFIG_LINUX) += fsdev/ common-obj-y += migration.o migration-tcp.o +common-obj-$(CONFIG_RDMA) += migration-rdma.o common-obj-y += qemu-char.o #aio.o common-obj-y += block-migration.o common-obj-y += page_cache.o xbzrle.o
configure +29 -0
@@ -180,6 +180,7 @@ xfs="" vhost_net="no" vhost_scsi="no" kvm="no" +rdma="" gprof="no" debug_tcg="no" debug="no"
@@ -936,6 +937,10 @@ for opt do ;; --enable-gtk) gtk="yes" ;; + --enable-rdma) rdma="yes" + ;; + --disable-rdma) rdma="no" + ;; --with-gtkabi=*) gtkabi="$optarg" ;; --enable-tpm) tpm="yes"
@@ -1094,6 +1099,8 @@ echo " --enable-bluez enable bluez stack connectivity" echo " --disable-slirp disable SLIRP userspace network connectivity" echo " --disable-kvm disable KVM acceleration support" echo " --enable-kvm enable KVM acceleration support" +echo " --disable-rdma disable RDMA-based migration support" +echo " --enable-rdma enable RDMA-based migration support" echo " --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI)" echo " --disable-nptl disable usermode NPTL support" echo " --enable-nptl enable usermode NPTL support"
@@ -1796,6 +1803,23 @@ EOF libs_softmmu="$sdl_libs $libs_softmmu" fi +if test "$rdma" != "no" ; then + cat > $TMPC <<EOF +#include <rdma/rdma_cma.h> +int main(void) { return 0; } +EOF + rdma_libs="-lrdmacm -libverbs" + if compile_prog "-Werror" "$rdma_libs" ; then + rdma="yes" + libs_softmmu="$libs_softmmu $rdma_libs" + else + if test "$rdma" = "yes" ; then + feature_not_found "rdma" + fi + rdma="no" + fi +fi + ########################################## # VNC TLS/WS detection if test "$vnc" = "yes" -a \( "$vnc_tls" != "no" -o "$vnc_ws" != "no" \) ; then
@@ -3525,6 +3549,7 @@ echo "Linux AIO support $linux_aio" echo "ATTR/XATTR support $attr" echo "Install blobs $blobs" echo "KVM support $kvm" +echo "RDMA support $rdma" echo "TCG interpreter $tcg_interpreter" echo "fdt support $fdt" echo "preadv support $preadv"
@@ -4464,6 +4489,10 @@ if [ "$pixman" = "internal" ]; then echo "config-host.h: subdir-pixman" >> $config_host_mak fi +if test "$rdma" = "yes" ; then +echo "CONFIG_RDMA=y" >> $config_host_mak +fi + if [ "$dtc_internal" = "yes" ]; then echo "config-host.h: subdir-dtc" >> $config_host_mak fi
include/migration/migration.h +4 -0
@@ -77,6 +77,10 @@ void fd_start_incoming_migration(const char *path, Error **errp);void fd_start_outgoing_migration (MigrationState *s,const char *fdname,Error **errp); +void rdma_start_outgoing_migration (void *opaque,const char *host_port,Error **errp); + +void rdma_start_incoming_migration (const char *host_port,Error **errp); +void migrate_fd_error (MigrationState *s);void migrate_fd_connect (MigrationState *s);
migration-rdma.c new file +2789 -0
2,789 lines not on this page · raw message
migration.c +8 -0
@@ -78,6 +78,10 @@ void qemu_start_incoming_migration(const char *uri, Error **errp)if (strstart (uri,"tcp:" , &p))tcp_start_incoming_migration (p, errp); +#ifdef CONFIG_RDMA + else if (strstart(uri, "x-rdma:", &p)) +rdma_start_incoming_migration (p, errp); +#endif #if !defined(WIN32 ) else if (strstart(uri, "exec:", &p)) exec_start_incoming_migration(p, errp);
@@ -407,6 +411,10 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,if (strstart (uri,"tcp:" , &p)) {tcp_start_outgoing_migration (s, p, &local_err); +#ifdef CONFIG_RDMA + }else if (strstart (uri,"x-rdma:" , &p)) { +rdma_start_outgoing_migration (s, p, &local_err); +#endif #if !defined(WIN32 ) } else if (strstart(uri, "exec:", &p)) {exec_start_outgoing_migration (s, p, &local_err);
Signature · 1 line
1.7.10.4
PATCH v12 15/15 rdma: account for the time spent in MIG_STATE_SETUP through QMP
In reply to [email protected]From: "Michael R. Hines" <[email protected]>
Using the previous patches, we're now able to timestamp the SETUP state. Once we have this time, let the user know about it in the schema.
--- hmp.c | 4 ++++ include/migration/migration.h | 1 + migration.c | 9 +++++++++ qapi-schema.json | 9 ++++++++- 4 files changed, 22 insertions(+), 1 deletion(-)
hmp.c +4 -0
@@ -164,6 +164,10 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict)monitor_printf (mon,"downtime: %" PRIu64" milliseconds\n" , info->downtime); } +if (info->has_setup_time) { +monitor_printf (mon,"setup: %" PRIu64" milliseconds\n" , + info->setup_time); + } }if (info->has_ram) {
include/migration/migration.h +1 -0
@@ -49,6 +49,7 @@ struct MigrationStateint64_t dirty_bytes_rate;bool enabled_capabilities[MIGRATION_CAPABILITY_MAX ];int64_t xbzrle_cache_size; +int64_t setup_time; };void process_incoming_migration (QEMUFile *f);
migration.c +9 -0
@@ -191,6 +191,7 @@ MigrationInfo *qmp_query_migrate(Error **errp)case MIG_STATE_SETUP : info->has_status = true; info->status =g_strdup ("setup" ); + info->has_total_time = false;break ;case MIG_STATE_ACTIVE : info->has_status = true;
@@ -200,6 +201,8 @@ MigrationInfo *qmp_query_migrate(Error **errp) - s->total_time; info->has_expected_downtime = true; info->expected_downtime = s->expected_downtime; + info->has_setup_time = true; + info->setup_time = s->setup_time; info->has_ram = true; info->ram =g_malloc0 (sizeof (*info->ram));
@@ -231,6 +234,8 @@ MigrationInfo *qmp_query_migrate(Error **errp) info->total_time = s->total_time; info->has_downtime = true; info->downtime = s->downtime; + info->has_setup_time = true; + info->setup_time = s->setup_time; info->has_ram = true; info->ram =g_malloc0 (sizeof (*info->ram));
@@ -522,6 +527,7 @@ static void *migration_thread(void *opaque) {MigrationState *s = opaque;int64_t initial_time =qemu_get_clock_ms (rt_clock); +int64_t setup_start =qemu_get_clock_ms (host_clock);int64_t initial_bytes =0 ;int64_t max_size =0 ;int64_t start_time = initial_time;
@@ -530,8 +536,11 @@ static void *migration_thread(void *opaque)DPRINTF ("beginning savevm\n" );qemu_savevm_state_begin (s->file, &s->params); + s->setup_time =qemu_get_clock_ms (host_clock) - setup_start;migrate_set_state (s,MIG_STATE_SETUP ,MIG_STATE_ACTIVE ); +DPRINTF ("setup complete\n" ); +while (s->state ==MIG_STATE_ACTIVE ) {int64_t current_time;uint64_t pending_size;
qapi-schema.json +8 -1
@@ -578,6 +578,12 @@ # expected downtime in milliseconds for the guest in last walk # of the dirty bitmap. (since 1.3) # +# @setup-time: #optional amount of setup time spent _before_ the iterations +# begin but _after_ the QMP command is issued. This is designed to +# provide an accounting of any activities (such as RDMA pinning) which +# may be expensive, but do not actually occur during the iterative +# migration rounds themselves. (since 1.6) +# # Since: 0.14.0 ## { 'type': 'MigrationInfo',
@@ -586,7 +592,8 @@ '*xbzrle-cache': 'XBZRLECacheStats', '*total-time': 'int', '*expected-downtime': 'int', - '*downtime': 'int'} } + '*downtime': 'int', + '*setup-time' : 'int'} } ## # @query-migrate
Signature · 1 line
1.7.10.4
v12 cover rdma: migration support
In reply to [email protected]Changes since v11:
- Minor state transition fix
- Fixed localhost migration
- Fixed 0.0.0.0 migration
- Drop invalid hunk
- Updated tags
Michael R. Hines (15):
rdma: add documentation
rdma: introduce qemu_update_position()
rdma: export yield_until_fd_readable()
rdma: export throughput w/ MigrationStats QMP
rdma: introduce qemu_file_mode_is_not_valid()
rdma: export qemu_fflush()
rdma: introduce ram_handle_compressed()
rdma: introduce qemu_ram_foreach_block()
rdma: new QEMUFileOps hooks
rdma: introduce capability x-rdma-pin-all
rdma: core logic
rdma: send pc.ram
rdma: allow state transitions between other states besides ACTIVE
rdma: introduce MIG_STATE_NONE and change MIG_STATE_SETUP state
transition
rdma: account for the time spent in MIG_STATE_SETUP through QMP
Makefile.objs | 1 + arch_init.c | 69 +- configure | 29 + docs/rdma.txt | 415 ++++++ exec.c | 9 + hmp.c | 6 + include/block/coroutine.h | 6 + include/exec/cpu-common.h | 5 + include/migration/migration.h | 32 + include/migration/qemu-file.h | 32 + migration-rdma.c | 2789 +++++++++++++++++++++++++++++++++++++++++ migration.c | 63 +- qapi-schema.json | 21 +- qemu-coroutine-io.c | 23 + savevm.c | 114 +- 15 files changed, 3554 insertions(+), 60 deletions(-) create mode 100644 docs/rdma.txt create mode 100644 migration-rdma.c
Signature · 1 line
1.7.10.4
Re: [Qemu-devel] [PATCH v12 08/15] rdma: introduce qemu_ram_foreach_block()
In reply to [email protected]Quoted 20 lines · On 26 June 2013 02:35, <[email protected]> wrote:
exec.c +9
-0@@ -2630,3 +2630,12 @@ bool cpu_physical_memory_is_io(hwaddr phys_addr) memory_region_is_romd(mr)); }#endif + +void qemu_ram_foreach_block (RAMBlockIterFunc func,void *opaque) +{ +RAMBlock *block; + + QTAILQ_FOREACH(block, &ram_list.blocks, next) { +func (block->host, block->offset, block->length, opaque); + } +}include/exec/cpu-common.h +0
-0
include/exec/cpu-common.h void cpu_physical_memory_write_rom(hwaddr addr, · line 121
Quoted 9 lines
include/exec/cpu-common.h +5
-0@@ -113,6 +113,11 @@ void cpu_physical_memory_write_rom(hwaddr addr,extern struct MemoryRegion io_mem_rom;extern struct MemoryRegion io_mem_notdirty; +typedef void (RAMBlockIterFunc )(void *host_addr, +ram_addr_t offset,ram_addr_t length,void *opaque); + +void qemu_ram_foreach_block (RAMBlockIterFunc func,void *opaque); +#endif
The prototype is inside an ifndef CONFIG_USER_ONLY -- the implementation needs to be as well.
thanks
-- PMM
Re: [Qemu-devel] [PATCH v12 08/15] rdma: introduce qemu_ram_foreach_block()
Quoted 33 lines · Peter Maydell
Quoted 20 lines · On 26 June 2013 02:35, <[email protected]> wrote:
exec.c +9
-0@@ -2630,3 +2630,12 @@ bool cpu_physical_memory_is_io(hwaddr phys_addr) memory_region_is_romd(mr)); }#endif + +void qemu_ram_foreach_block (RAMBlockIterFunc func,void *opaque) +{ +RAMBlock *block; + + QTAILQ_FOREACH(block, &ram_list.blocks, next) { +func (block->host, block->offset, block->length, opaque); + } +}include/exec/cpu-common.h +0
-0include/exec/cpu-common.h void cpu_physical_memory_write_rom(hwaddr addr, · line 121
Quoted 9 lines
include/exec/cpu-common.h +5
-0@@ -113,6 +113,11 @@ void cpu_physical_memory_write_rom(hwaddr addr,extern struct MemoryRegion io_mem_rom;extern struct MemoryRegion io_mem_notdirty; +typedef void (RAMBlockIterFunc )(void *host_addr, +ram_addr_t offset,ram_addr_t length,void *opaque); + +void qemu_ram_foreach_block (RAMBlockIterFunc func,void *opaque); +#endif The prototype is inside an ifndef
CONFIG_USER_ONLY-- the implementation needs to be as well.
Quoted 3 lines
thanks
-- PMM
Good catch. I'll send it in the next patch series ASAP.
- Michael
Re: [Qemu-devel] [PATCH v12 01/15] rdma: add documentation
In reply to [email protected]Quoted 16 lines · On 06/25/2013 07:35 PM, [email protected] wrote:
From: "Michael R. Hines" <[email protected]>
docs/rdma.txtcontains full documentation, wiki links, github url and contact information.Reviewed-by Juan Quintela <[email protected]>Reviewed-by Paolo Bonzini <[email protected]>Reviewed-by Chegu Vinod <[email protected]>Tested-by Chegu Vinod <[email protected]>Tested-by Michael R. Hines <[email protected]>Signed-off-by Michael R. Hines <[email protected]>--- docs/rdma.txt | 415 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 415 insertions(+) create mode 100644 docs/rdma.txt
docs/rdma.txt line 38
Quoted 3 lines
docs/rdma.txt new file +3
-0+ +RDMA currently comes in two flavors: both Ethernet based (RoCE, or RDMA +over Convered Ethernet) as well as Infiniband-based. This implementation of
s/Convered/Converged/ ?
docs/rdma.txt line 246
Quoted 7 lines
docs/rdma.txt new file +7
-0+qemu_rdma_exchange_send(header, data, optional response header & data): + +1. Block on the CQ event channel waiting for a READY command + from the receiver to tell us that the receiver + is *ready* for us to transmit some new bytes. +2. Optionally: if we are expecting a response from the command + (that we have no yet transmitted), let's post an RQ
s/no/not/
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Re: [Qemu-devel] [PATCH v12 01/15] rdma: add documentation
Quoted 21 lines · Eric Blake
Quoted 15 lines · On 06/25/2013 07:35 PM, [email protected] wrote:
From: "Michael R. Hines" <[email protected]>
docs/rdma.txtcontains full documentation, wiki links, github url and contact information.Reviewed-by Juan Quintela <[email protected]>Reviewed-by Paolo Bonzini <[email protected]>Reviewed-by Chegu Vinod <[email protected]>Tested-by Chegu Vinod <[email protected]>Tested-by Michael R. Hines <[email protected]>Signed-off-by Michael R. Hines <[email protected]>--- docs/rdma.txt | 415 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 415 insertions(+)create mode 100644
docs/rdma.txtdocs/rdma.txt line 38
Quoted 3 lines
docs/rdma.txt new file +3
-0+ +RDMA currently comes in two flavors: both Ethernet based (RoCE, or RDMA +over Convered Ethernet) as well as Infiniband-based. This implementation ofs/Convered/Converged/ ?
Quoted 9 lines
docs/rdma.txt line 246
Quoted 7 lines
docs/rdma.txt new file +7
-0+qemu_rdma_exchange_send(header, data, optional response header & data): + +1. Block on the CQ event channel waiting for a READY command + from the receiver to tell us that the receiver + is *ready* for us to transmit some new bytes. +2. Optionally: if we are expecting a response from the command + (that we have no yet transmitted), let's post an RQs/no/not/
Good eye - thanks a lot.
- Michael
Re: [Qemu-devel] [PATCH v12 15/15] rdma: account for the time spent in MIG_STATE_SETUP through QMP
In reply to [email protected]Quoted 8 lines · On 06/25/2013 07:35 PM, [email protected] wrote:
From: "Michael R. Hines" <[email protected]>
Using the previous patches, we're now able to timestamp the SETUP state. Once we have this time, let the user know about it in the schema.
Reviewed-by Juan Quintela <[email protected]>Signed-off-by Michael R. Hines <[email protected]>
Usually, Reviewed-by lines are listed _after_ S-o-b lines - signature lines are typically chronological, but the patch has to be signed before a review can have any weight at getting the patch into a pull request :)
Quoted 10 lines
--- hmp.c | 4 ++++ include/migration/migration.h | 1 + migration.c | 9 +++++++++ qapi-schema.json | 9 ++++++++- 4 files changed, 22 insertions(+), 1 deletion(-)+++
b/qapi-schema.json
qapi-schema.json line 582
Quoted 5 lines
qapi-schema.json +2
-0@@ -578,6 +578,12 @@ # expected downtime in milliseconds for the guest in last walk # of the dirty bitmap. (since 1.3) # +# @setup-time: #optional amount of setup time spent _before_ the iterations +# begin but _after_ the QMP command is issued. This is designed to
In what units? One can easily assume milliseconds, based on the docs of other elapsed time parameters, but being explicit never hurts.
Quoted 8 lines
qapi-schema.json +4
-0+# provide an accounting of any activities (such as RDMA pinning) which +# may be expensive, but do not actually occur during the iterative +# migration rounds themselves. (since 1.6) +# # Since: 0.14.0 ## { 'type': 'MigrationInfo',
qapi-schema.json line 596
Quoted 6 lines
qapi-schema.json +2
-1@@ -586,7 +592,8 @@ '*xbzrle-cache': 'XBZRLECacheStats', '*total-time': 'int', '*expected-downtime': 'int', - '*downtime': 'int'} } + '*downtime': 'int', + '*setup-time' : 'int'} }
We typically don't have space before ':' (as seen in the other lines just above). I can live with the patch as-is, but if you respin the series for other things, then fix those two things before adding
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Re: [Qemu-devel] [PATCH v12 04/15] rdma: export throughput w/ MigrationStats QMP
In reply to [email protected]Quoted 10 lines · On 06/25/2013 07:35 PM, [email protected] wrote:
From: "Michael R. Hines" <[email protected]>
This exposes throughput (in megabits/sec) through QMP.
Reviewed-by Juan Quintela <[email protected]>Reviewed-by Paolo Bonzini <[email protected]>Reviewed-by Chegu Vinod <[email protected]>Tested-by Chegu Vinod <[email protected]>Tested-by Michael R. Hines <[email protected]>Signed-off-by Michael R. Hines <[email protected]>
S-o-b should generally be first (signatures are typically appended chronologically, and it's hard for anyone else to review or test a patch that hasn't been posted, whereas you should always be signing patches even on first posting :)
Quoted 6 lines
--- hmp.c | 2 ++ include/migration/migration.h | 1 + migration.c | 6 ++++++ qapi-schema.json | 5 ++++- 4 files changed, 13 insertions(+), 1 deletion(-)
But as long as we are listing names, feel free to add:
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Paolo Bonzini
Reviewed-by Juan QuintelaRe: [Qemu-devel] [PATCH v12 15/15] rdma: account for the time spent in MIG_STATE_SETUP through QMP
In reply to Eric Blake-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Il 28/06/2013 00:58, Eric Blake ha scritto:
Quoted 11 lines
Quoted 6 lines
Using the previous patches, we're now able to timestamp the SETUP state. Once we have this time, let the user know about it in the schema.
Reviewed-by Juan Quintela <[email protected]> Signed-off-by:Michael R. Hines <[email protected]>
Usually, Reviewed-by lines are listed _after_ S-o-b lines - signature lines are typically chronological, but the patch has to be signed before a review can have any weight at getting the patch into a pull request :)
Hmm, that's not how I understood it. The last line in the message should be S-o-b. If _I_ collect the Reviewed-bys when committing, I'll do
But since Michael is the one collecting the tags from previous submissions of the patch series, he's placing it right.
Paolo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJRzTf4AAoJEBvWZb6bTYby33kP/A1oAqs6djatLmvKXwFa4uq/ XgDvn8TZq/TP+I8a3v8rvMiw8MbLYP+YBKvuwKmUb/WKHmdvDFzZeNRRI/DBVOb6 c8qMlc6sGCZW1R8+aBq1lYJf/sXlXFdE+owL4gVfujJzHdFn1N9hllWXFGxqnXDk G7mJHPsyFA2B2W+4rJvfJozvJHsT9IviA+iXcAZMqGPH22VvOzcBodeE6Y9kYTmN a3cRUkygY7wi4rTsxqbc1oQ1575FUL3xt7QPx2B47vT6C04n/mC5fCMHbgwS0oiJ +YRQap6Lnnd3FgKwpXh4lJamA7n+HT/3H5GC2nlr86MmR/sU6+zeYmksKgDhs8L1 l8QcWc+aQ0urfN29oUxhNChilI/0TWlcTIe8XyxgEpPeZ9KM4rCBVMIui0YYjaUK B4mrxpqi1s9dP4Tx4VEgr46LIx2aTen5vhurFlfHVvLse9UqX8QUwmymZJTw+OIv jLL37XfN2L2vfS8TTyr+a1Z1lrcyi0E5nY1IEm6UnH1wZB/kRdh9F5DgkPjB7tob 2GlJBBH9oNs2ohHfS3/4WdYq8zPx5rSlSqy0PfctgtIHR7+LblxLP4wcTDKm+apM yx3bfEDEyBta0js+SME0nU2gVWfTJEJBNSnARax5Sxe06/NShOtJ9vqOSUlMk4SY v5R7ZkeDsKYuKBvDHRel
=n0+a
-----END PGP SIGNATURE-----
Re: [Qemu-devel] [PATCH v12 04/15] rdma: export throughput w/ MigrationStats QMP
In reply to Eric BlakeQuoted 11 lines · Eric Blake
Quoted 10 lines · On 06/25/2013 07:35 PM, [email protected] wrote:
From: "Michael R. Hines" <[email protected]>
This exposes throughput (in megabits/sec) through QMP.
Reviewed-by Juan Quintela <[email protected]>Reviewed-by Paolo Bonzini <[email protected]>Reviewed-by Chegu Vinod <[email protected]>Tested-by Chegu Vinod <[email protected]>Tested-by Michael R. Hines <[email protected]>Signed-off-by Michael R. Hines <[email protected]>
Quoted 4 lines
S-o-b should generally be first (signatures are typically appended chronologically, and it's hard for anyone else to review or test a patch that hasn't been posted, whereas you should always be signing patches even on first posting :)
Understood, thank you. =)
Quoted 10 lines
Quoted 6 lines
--- hmp.c | 2 ++ include/migration/migration.h | 1 + migration.c | 6 ++++++ qapi-schema.json | 5 ++++- 4 files changed, 13 insertions(+), 1 deletion(-)But as long as we are listing names, feel free to add:
Reviewed-by Eric Blake <[email protected]>
Re: [Qemu-devel] [PATCH v12 15/15] rdma: account for the time spent in MIG_STATE_SETUP through QMP
In reply to Eric BlakeQuoted 48 lines · Eric Blake
Quoted 8 lines · On 06/25/2013 07:35 PM, [email protected] wrote:
From: "Michael R. Hines" <[email protected]>
Using the previous patches, we're now able to timestamp the SETUP state. Once we have this time, let the user know about it in the schema.
Reviewed-by Juan Quintela <[email protected]>Signed-off-by Michael R. Hines <[email protected]>Usually, Reviewed-by lines are listed _after_ S-o-b lines - signature lines are typically chronological, but the patch has to be signed before a review can have any weight at getting the patch into a pull request :)
Quoted 9 lines
--- hmp.c | 4 ++++ include/migration/migration.h | 1 + migration.c | 9 +++++++++ qapi-schema.json | 9 ++++++++- 4 files changed, 22 insertions(+), 1 deletion(-)+++
b/qapi-schema.jsonqapi-schema.json line 582
Quoted 5 lines
qapi-schema.json +2
-0@@ -578,6 +578,12 @@ # expected downtime in milliseconds for the guest in last walk # of the dirty bitmap. (since 1.3) # +# @setup-time: #optional amount of setup time spent _before_ the iterations +# begin but _after_ the QMP command is issued. This is designed toIn what units? One can easily assume milliseconds, based on the docs of other elapsed time parameters, but being explicit never hurts.
Quoted 8 lines
qapi-schema.json +4
-0+# provide an accounting of any activities (such as RDMA pinning) which +# may be expensive, but do not actually occur during the iterative +# migration rounds themselves. (since 1.6) +# # Since: 0.14.0 ## { 'type': 'MigrationInfo',qapi-schema.json line 596
Quoted 6 lines
qapi-schema.json +2
-1@@ -586,7 +592,8 @@ '*xbzrle-cache': 'XBZRLECacheStats', '*total-time': 'int', '*expected-downtime': 'int', - '*downtime': 'int'} } + '*downtime': 'int', + '*setup-time' : 'int'} }We typically don't have space before ':' (as seen in the other lines just above). I can live with the patch as-is, but if you respin the series for other things, then fix those two things before adding
Quoted 2 lines
Reviewed-by Eric Blake <[email protected]>
Good catches.....thank you.
Re: [Qemu-devel] [PATCH v12 15/15] rdma: account for the time spent in MIG_STATE_SETUP through QMP
In reply to Paolo BonziniQuoted 29 lines · Paolo Bonzini
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Il 28/06/2013 00:58, Eric Blake ha scritto:
Quoted 10 lines
Quoted 6 lines
Using the previous patches, we're now able to timestamp the SETUP state. Once we have this time, let the user know about it in the schema.
Reviewed-by Juan Quintela <[email protected]> Signed-off-by:Michael R. Hines <[email protected]>
Usually, Reviewed-by lines are listed _after_ S-o-b lines - signature lines are typically chronological, but the patch has to be signed before a review can have any weight at getting the patch into a pull request :)
Hmm, that's not how I understood it. The last line in the message should be S-o-b. If _I_ collect the Reviewed-bys when committing, I'll do
Signed-off-by Michael R. Hines <[email protected]>Reviewed-by Juan Quintela <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>But since Michael is the one collecting the tags from previous submissions of the patch series, he's placing it right.
Paolo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
Quoted 15 lines
iQIcBAEBAgAGBQJRzTf4AAoJEBvWZb6bTYby33kP/A1oAqs6djatLmvKXwFa4uq/ XgDvn8TZq/TP+I8a3v8rvMiw8MbLYP+YBKvuwKmUb/WKHmdvDFzZeNRRI/DBVOb6 c8qMlc6sGCZW1R8+aBq1lYJf/sXlXFdE+owL4gVfujJzHdFn1N9hllWXFGxqnXDk G7mJHPsyFA2B2W+4rJvfJozvJHsT9IviA+iXcAZMqGPH22VvOzcBodeE6Y9kYTmN a3cRUkygY7wi4rTsxqbc1oQ1575FUL3xt7QPx2B47vT6C04n/mC5fCMHbgwS0oiJ +YRQap6Lnnd3FgKwpXh4lJamA7n+HT/3H5GC2nlr86MmR/sU6+zeYmksKgDhs8L1 l8QcWc+aQ0urfN29oUxhNChilI/0TWlcTIe8XyxgEpPeZ9KM4rCBVMIui0YYjaUK B4mrxpqi1s9dP4Tx4VEgr46LIx2aTen5vhurFlfHVvLse9UqX8QUwmymZJTw+OIv jLL37XfN2L2vfS8TTyr+a1Z1lrcyi0E5nY1IEm6UnH1wZB/kRdh9F5DgkPjB7tob 2GlJBBH9oNs2ohHfS3/4WdYq8zPx5rSlSqy0PfctgtIHR7+LblxLP4wcTDKm+apM yx3bfEDEyBta0js+SME0nU2gVWfTJEJBNSnARax5Sxe06/NShOtJ9vqOSUlMk4SY v5R7ZkeDsKYuKBvDHRel
=n0+a
-----END PGP SIGNATURE-----
Oh. ok. Understood =)
Re: [Qemu-devel] [PATCH v12 15/15] rdma: account for the time spent in MIG_STATE_SETUP through QMP
In reply to Paolo BonziniQuoted 13 lines · Paolo Bonzini
Il 28/06/2013 00:58, Eric Blake ha scritto:
Quoted 11 lines
Quoted 6 lines
Using the previous patches, we're now able to timestamp the SETUP state. Once we have this time, let the user know about it in the schema.
Reviewed-by Juan Quintela <[email protected]> Signed-off-by:Michael R. Hines <[email protected]>
Usually, Reviewed-by lines are listed _after_ S-o-b lines - signature lines are typically chronological, but the patch has to be signed before a review can have any weight at getting the patch into a pull request :)
Quoted 6 lines
Hmm, that's not how I understood it. The last line in the message should be S-o-b. If _I_ collect the Reviewed-bys when committing, I'll do
Signed-off-by Michael R. Hines <[email protected]>Reviewed-by Juan Quintela <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>
That's what I meant by signatures being chronological. The _first_ line is Michael's s-o-b, since he wrote it; on any of Michael's respins where he adds signatures collected during the review process (which will only be reviewed-by or tested-by - here a review from Juan), those come next; then when the maintainer incorporates the patch into a pull request, further signatures are collected (any reviewed-by that were not incorporated by Michael because no respin was required, followed by the final s-o-b saying the maintainer modified the commit message as part of incorporating into the pull request).
Quoted 2 lines
But since Michael is the one collecting the tags from previous submissions of the patch series, he's placing it right.
Having Michael's s-o-b last, after reviewed-by picked up from earlier revisions, is not chronological. Maintainers add reviewed-by before their own s-o-b, but only because their s-o-b is a secondary s-o-b; I still don't see why the original author would add reviewed-by before their (lone) s-o-b.
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Re: [Qemu-devel] [PATCH v12 15/15] rdma: account for the time spent in MIG_STATE_SETUP through QMP
Quoted 28 lines · Eric Blake
Quoted 11 lines · Paolo Bonzini
Il 28/06/2013 00:58, Eric Blake ha scritto:
Quoted 10 lines
Quoted 6 lines
Using the previous patches, we're now able to timestamp the SETUP state. Once we have this time, let the user know about it in the schema.
Reviewed-by Juan Quintela <[email protected]> Signed-off-by:Michael R. Hines <[email protected]>
Usually, Reviewed-by lines are listed _after_ S-o-b lines - signature lines are typically chronological, but the patch has to be signed before a review can have any weight at getting the patch into a pull request :)
Quoted 6 lines
Hmm, that's not how I understood it. The last line in the message should be S-o-b. If _I_ collect the Reviewed-bys when committing, I'll do
Signed-off-by Michael R. Hines <[email protected]>Reviewed-by Juan Quintela <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>That's what I meant by signatures being chronological. The _first_ line is Michael's s-o-b, since he wrote it; on any of Michael's respins where he adds signatures collected during the review process (which will only be reviewed-by or tested-by - here a review from Juan), those come next; then when the maintainer incorporates the patch into a pull request, further signatures are collected (any reviewed-by that were not incorporated by Michael because no respin was required, followed by the final s-o-b saying the maintainer modified the commit message as part of incorporating into the pull request).
Quoted 8 lines
Quoted 2 lines
But since Michael is the one collecting the tags from previous submissions of the patch series, he's placing it right.
Having Michael's s-o-b last, after reviewed-by picked up from earlier revisions, is not chronological. Maintainers add reviewed-by before their own s-o-b, but only because their s-o-b is a secondary s-o-b; I still don't see why the original author would add reviewed-by before their (lone) s-o-b.
I don't mind prioritizing the reviewers. Everyone is putting in way more review time than they probably otherwise want to. =)
Besides, the author's name is all over the email list - so it's obvious that the email sender will have an s-o-b. It's less obvious who reviewed the patch.
- Michael