From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id 5EC671BE0; Fri, 4 May 2018 17:11:32 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F366F722C3; Fri, 4 May 2018 15:11:31 +0000 (UTC) Received: from [10.36.112.52] (ovpn-112-52.ams2.redhat.com [10.36.112.52]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C8A012141200; Fri, 4 May 2018 15:11:30 +0000 (UTC) To: xiangxia.m.yue@gmail.com, jianfeng.tan@intel.com, yliu@fridaylinux.org Cc: dev@dpdk.org, stable@dpdk.org References: <1524842385-61707-1-git-send-email-xiangxia.m.yue@gmail.com> From: Maxime Coquelin Message-ID: Date: Fri, 4 May 2018 17:11:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1524842385-61707-1-git-send-email-xiangxia.m.yue@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 04 May 2018 15:11:32 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 04 May 2018 15:11:32 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'maxime.coquelin@redhat.com' RCPT:'' Subject: Re: [dpdk-dev] [PATCH 1/3] vhost: fix deadlock due to vhostuser socket and fdset X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 May 2018 15:11:32 -0000 On 04/27/2018 05:19 PM, xiangxia.m.yue@gmail.com wrote: > From: Tonghao Zhang > > When qemu close the unix socket fd of the vhostuser as a > server, and then immediately delete the vhostuser port on > openvswitch. There will be a deadlock. > > A thread (fdset event thread): B thread: > 1. fdset_event_dispatch rte_vhost_driver_unregister > 2. set the fd busy to 1. lock vsocket->conn_mutex > 3. vhost_user_read_cb fdset_del waits busy changed to 0. > 4. vhost peer closed, remove the > conn from vsocket->conn_list: > lock vsocket->conn_mutex > > 5. set the fd busy to 0 > > Fixes: 65388b43 ("vhost: fix fd leaks for vhost-user server mode") > Cc: stable@dpdk.org > Cc: Yuanhan Liu > Signed-off-by: Tonghao Zhang > --- > lib/librte_vhost/fd_man.c | 32 ++++++++++++++++++++++++++++++++ > lib/librte_vhost/fd_man.h | 1 + > lib/librte_vhost/socket.c | 13 ++++++++++++- > 3 files changed, 45 insertions(+), 1 deletion(-) > Applied to dpdk-next-virtio/master. Please next time add a cover-letter and run check-git-log.sh and checkpatch.sh scripts before submitting. Thanks! Maxime