From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 1A1D21B31E; Fri, 26 Jan 2018 13:40:42 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 629765C9DB; Fri, 26 Jan 2018 12:40:41 +0000 (UTC) Received: from localhost (dhcp-192-241.str.redhat.com [10.33.192.241]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0B6EA75A1A; Fri, 26 Jan 2018 12:40:35 +0000 (UTC) Date: Fri, 26 Jan 2018 13:40:33 +0100 From: Jens Freimann To: Maxime Coquelin Cc: yliu@fridaylinux.org, tiwei.bie@intel.com, jianfeng.tan@intel.com, ferruh.yigit@intel.com, dev@dpdk.org, stable@dpdk.org Message-ID: <20180126124033.qawyksgcgja2kb32@dhcp-192-241.str.redhat.com> References: <20180125150653.32284-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20180125150653.32284-1-maxime.coquelin@redhat.com> User-Agent: NeoMutt/20171215 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 26 Jan 2018 12:40:41 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH] vhost: fix iotlb pool out-of-memory handling 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, 26 Jan 2018 12:40:43 -0000 On Thu, Jan 25, 2018 at 04:06:53PM +0100, Maxime Coquelin wrote: >In the unlikely case the IOTLB memory pool runs out of memory, >an issue may happen if all entries are used by the IOTLB cache, >and an IOTLB miss happen. If the iotlb pending list is empty, >then no memory is freed and allocation fails a second time. > >This patch fixes this by doing an IOTLB cache random evict if >the IOTLB pending list is empty, ensuring the second allocation >try will succeed. > >In the same spirit, the opposite is done when inserting an >IOTLB entry in the IOTLB cache fails due to out of memory. In >this case, the IOTLB pending is flushed if the IOTLB cache is >empty to ensure the new entry can be inserted. > >Fixes: d012d1f293f4 ("vhost: add IOTLB helper functions") >Fixes: f72c2ad63aeb ("vhost: add pending IOTLB miss request list and helpers") > >Cc: stable@dpdk.org >Signed-off-by: Maxime Coquelin >--- > lib/librte_vhost/iotlb.c | 18 +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) > Reviewed-by: Jens Freimann regards, Jens