qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Lidong Chen <jemmy858585@gmail.com>,
	quintela@redhat.com, dgilbert@redhat.com, berrange@redhat.com
Cc: adido@mellanox.com, galsha@mellanox.com, aviadye@mellanox.com,
	qemu-devel@nongnu.org, Lidong Chen <lidongchen@tencent.com>
Subject: Re: [Qemu-devel] [PATCH v3 5/6] migration: implement bi-directional RDMA QIOChannel
Date: Tue, 15 May 2018 16:54:30 +0200	[thread overview]
Message-ID: <379b3f13-f53f-966b-ccbf-66517d45aa9d@redhat.com> (raw)
In-Reply-To: <1525530936-21835-6-git-send-email-lidongchen@tencent.com>

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

  reply	other threads:[~2018-05-15 14:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-05 14:35 [Qemu-devel] [PATCH v3 0/6] Enable postcopy RDMA live migration Lidong Chen
2018-05-05 14:35 ` [Qemu-devel] [PATCH v3 1/6] migration: disable RDMA WRITE after postcopy started Lidong Chen
2018-05-05 14:35 ` [Qemu-devel] [PATCH v3 2/6] migration: create a dedicated connection for rdma return path Lidong Chen
2018-05-05 14:35 ` [Qemu-devel] [PATCH v3 3/6] migration: remove unnecessary variables len in QIOChannelRDMA Lidong Chen
2018-05-08 14:19   ` Dr. David Alan Gilbert
2018-05-09  1:28     ` 858585 jemmy
2018-05-05 14:35 ` [Qemu-devel] [PATCH v3 4/6] migration: avoid concurrent invoke channel_close by different threads Lidong Chen
2018-05-05 14:35 ` [Qemu-devel] [PATCH v3 5/6] migration: implement bi-directional RDMA QIOChannel Lidong Chen
2018-05-15 14:54   ` Paolo Bonzini [this message]
2018-05-16  9:36     ` 858585 jemmy
2018-05-21 11:49       ` 858585 jemmy
2018-05-23  2:36         ` 858585 jemmy
2018-05-05 14:35 ` [Qemu-devel] [PATCH v3 6/6] migration: Stop rdma yielding during incoming postcopy Lidong Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=379b3f13-f53f-966b-ccbf-66517d45aa9d@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=adido@mellanox.com \
    --cc=aviadye@mellanox.com \
    --cc=berrange@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=galsha@mellanox.com \
    --cc=jemmy858585@gmail.com \
    --cc=lidongchen@tencent.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).