[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 5/6] migration: implement bi-directional RDMA
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v3 5/6] migration: implement bi-directional RDMA QIOChannel |
Date: |
Tue, 15 May 2018 16:54:30 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
On 05/05/2018 16:35, Lidong Chen wrote:
> @@ -2635,12 +2637,20 @@ static ssize_t qio_channel_rdma_writev(QIOChannel
> *ioc,
> {
> QIOChannelRDMA *rioc = QIO_CHANNEL_RDMA(ioc);
> QEMUFile *f = rioc->file;
> - RDMAContext *rdma = rioc->rdma;
> + RDMAContext *rdma;
> int ret;
> ssize_t done = 0;
> size_t i;
> size_t len = 0;
>
> + rcu_read_lock();
> + rdma = atomic_rcu_read(&rioc->rdmaout);
> +
> + if (!rdma) {
> + rcu_read_unlock();
> + return -EIO;
> + }
> +
> CHECK_ERROR_STATE();
>
> /*
I am not sure I understand this. It would probably be wrong to use the
output side from two threads at the same time, so why not use two mutexes?
Also, who is calling qio_channel_rdma_close in such a way that another
thread is still using it? Would it be possible to synchronize with the
other thread *before*, for example with qemu_thread_join?
Thanks,
Paolo
- [Qemu-devel] [PATCH v3 0/6] Enable postcopy RDMA live migration, Lidong Chen, 2018/05/05
- [Qemu-devel] [PATCH v3 1/6] migration: disable RDMA WRITE after postcopy started, Lidong Chen, 2018/05/05
- [Qemu-devel] [PATCH v3 2/6] migration: create a dedicated connection for rdma return path, Lidong Chen, 2018/05/05
- [Qemu-devel] [PATCH v3 3/6] migration: remove unnecessary variables len in QIOChannelRDMA, Lidong Chen, 2018/05/05
- [Qemu-devel] [PATCH v3 4/6] migration: avoid concurrent invoke channel_close by different threads, Lidong Chen, 2018/05/05
- [Qemu-devel] [PATCH v3 6/6] migration: Stop rdma yielding during incoming postcopy, Lidong Chen, 2018/05/05
- [Qemu-devel] [PATCH v3 5/6] migration: implement bi-directional RDMA QIOChannel, Lidong Chen, 2018/05/05
- Re: [Qemu-devel] [PATCH v3 5/6] migration: implement bi-directional RDMA QIOChannel,
Paolo Bonzini <=