From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens Freimann Subject: Re: [PATCH 1/2] vhost: fix deadlock on IOTLB miss Date: Fri, 13 Oct 2017 13:32:04 +0200 Message-ID: <20171013113204.hmmkitx6m5ijhduj@dhcp-192-218.str.redhat.com> References: <20171012153850.21837-1-maxime.coquelin@redhat.com> <20171012153850.21837-2-maxime.coquelin@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Cc: yliu@fridaylinux.org, thomas@monjalon.net, dev@dpdk.org To: Maxime Coquelin Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 3E0C01B315 for ; Fri, 13 Oct 2017 13:32:12 +0200 (CEST) Content-Disposition: inline In-Reply-To: <20171012153850.21837-2-maxime.coquelin@redhat.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Oct 12, 2017 at 03:38:49PM +0000, Maxime Coquelin wrote: >An optimization was done to only take the iotlb cache lock >once per packet burst instead of once per IOVA translation. > >With this, IOTLB miss requests are sent to Qemu with the lock >held, which can cause a deadlock if the socket buffer is full, >and if Qemu is waiting for an IOTLB update to be done. > >Holding the lock is not necessary when sending an IOTLB miss >request, as it is not manipulating the IOTLB cache list, which >the lock protects. Let's just release it while sending the >IOTLB miss. > >Signed-off-by: Maxime Coquelin >--- > lib/librte_vhost/vhost.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > Seems to be safe, because in case of an IOTLB miss we only take a different lock. Reviewed-by: Jens Freimann