All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Chuan Zheng <zhengchuan@huawei.com>
Cc: yubihong@huawei.com, zhang.zhanghailiang@huawei.com,
	quintela@redhat.com, dgilbert@redhat.com, xiexiangyou@huawei.com,
	qemu-devel@nongnu.org, alex.chen@huawei.com,
	wanghao232@huawei.com
Subject: Re: [PATCH] migration/multifd: fix hangup with TLS-Multifd due to blocking handshake
Date: Tue, 10 Nov 2020 13:19:12 +0000	[thread overview]
Message-ID: <20201110131912.GF869656@redhat.com> (raw)
In-Reply-To: <1604643893-8223-1-git-send-email-zhengchuan@huawei.com>

On Fri, Nov 06, 2020 at 02:24:53PM +0800, Chuan Zheng wrote:
> The qemu main loop could hang up forever when we enable TLS+Multifd.
> The Src multifd_send_0 invokes tls handshake, it sends hello to sever
> and wait response.
> However, the Dst main qemu loop has been waiting recvmsg() for multifd_recv_1.
> Both of Src and Dst main qemu loop are blocking and waiting for reponse which
> results in hanging up forever.
> 
> Src: (multifd_send_0)                                              Dst: (multifd_recv_1)
> multifd_channel_connect                                            migration_channel_process_incoming
>   multifd_tls_channel_connect                                        migration_tls_channel_process_incoming
>     multifd_tls_channel_connect                                        qio_channel_tls_handshake_task
>        qio_channel_tls_handshake                                         gnutls_handshake
>           qio_channel_tls_handshake_task                                       ...
>             qcrypto_tls_session_handshake                                      ...
>               gnutls_handshake                                                 ...
>                    ...                                                         ...
>                 recvmsg (Blocking I/O waiting for response)                recvmsg (Blocking I/O waiting for response)
> 
> Fix this by offloadinig handshake work to a background thread.
> 
> Reported-by: Yan Jin <jinyan12@huawei.com>
> Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Chuan Zheng <zhengchuan@huawei.com>
> ---
>  migration/multifd.c | 23 +++++++++++++++++------
>  1 file changed, 17 insertions(+), 6 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2020-11-10 13:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-06  6:24 [PATCH] migration/multifd: fix hangup with TLS-Multifd due to blocking handshake Chuan Zheng
2020-11-10 13:19 ` Daniel P. Berrangé [this message]
2020-11-12 14:35 ` Dr. David Alan Gilbert

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=20201110131912.GF869656@redhat.com \
    --to=berrange@redhat.com \
    --cc=alex.chen@huawei.com \
    --cc=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=wanghao232@huawei.com \
    --cc=xiexiangyou@huawei.com \
    --cc=yubihong@huawei.com \
    --cc=zhang.zhanghailiang@huawei.com \
    --cc=zhengchuan@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.