[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 16/18] migration/rdma: add rdma_channel into Migrationstat
From: |
Zheng Chuan |
Subject: |
Re: [PATCH v4 16/18] migration/rdma: add rdma_channel into Migrationstate field |
Date: |
Mon, 1 Mar 2021 20:27:03 +0800 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 |
On 2021/2/4 4:19, Dr. David Alan Gilbert wrote:
> * Chuan Zheng (zhengchuan@huawei.com) wrote:
>> Multifd RDMA is need to poll when we send data, record it.
>
> This looks like it's trying to be the equivalent of the 'static int
> next_channel' in multifd_send_pages.
>
> If so, why not mkae this 'multifd_channel' and make the function
> 'multifd_next_channel' and replace the code in multifd_send_pages to use
> this as well, rather than make it a special for rdma.
>
> Dave
>
Yes, that's a good suggestion. I'll do it in V5.
>> Signed-off-by: Chuan Zheng <zhengchuan@huawei.com>
>> ---
>> migration/migration.c | 1 +
>> migration/migration.h | 1 +
>> migration/rdma.c | 14 ++++++++++++++
>> 3 files changed, 16 insertions(+)
>>
>> diff --git a/migration/migration.c b/migration/migration.c
>> index b8f4844..47bd11d 100644
>> --- a/migration/migration.c
>> +++ b/migration/migration.c
>> @@ -1926,6 +1926,7 @@ void migrate_init(MigrationState *s)
>> s->migration_thread_running = false;
>> s->enabled_rdma_migration = false;
>> s->host_port = NULL;
>> + s->rdma_channel = 0;
>> error_free(s->error);
>> s->error = NULL;
>> s->hostname = NULL;
>> diff --git a/migration/migration.h b/migration/migration.h
>> index 537ee09..5ff46e6 100644
>> --- a/migration/migration.h
>> +++ b/migration/migration.h
>> @@ -288,6 +288,7 @@ struct MigrationState {
>>
>> /* Need by Multi-RDMA */
>> char *host_port;
>> + int rdma_channel;
>> };
>>
>> void migrate_set_state(int *state, int old_state, int new_state);
>> diff --git a/migration/rdma.c b/migration/rdma.c
>> index f5eb563..2097839 100644
>> --- a/migration/rdma.c
>> +++ b/migration/rdma.c
>> @@ -183,6 +183,20 @@ typedef struct {
>> } RDMAWorkRequestData;
>>
>> /*
>> + * Get the multifd RDMA channel used to send data.
>> + */
>> +static int get_multifd_RDMA_channel(void)
>> +{
>> + int thread_count = migrate_multifd_channels();
>> + MigrationState *s = migrate_get_current();
>> +
>> + s->rdma_channel++;
>> + s->rdma_channel %= thread_count;
>> +
>> + return s->rdma_channel;
>> +}
>> +
>> +/*
>> * Negotiate RDMA capabilities during connection-setup time.
>> */
>> typedef struct {
>> --
>> 1.8.3.1
>>
--
Regards.
Chuan
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH v4 16/18] migration/rdma: add rdma_channel into Migrationstate field,
Zheng Chuan <=