From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] eal: check if hugedir write lock is already being held Date: Mon, 30 Apr 2018 15:27:32 +0200 Message-ID: <4914396.bRUXGW2plj@xps> References: <00fe124e2057fe6c5596fb0a24bdcce9b36c3b90.1525082912.git.anatoly.burakov@intel.com> <8d3e2cc3-d4fd-6c84-e136-aef593b5ea4d@solarflare.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Andrew Rybchenko To: Anatoly Burakov Return-path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 82D9F187 for ; Mon, 30 Apr 2018 15:27:35 +0200 (CEST) In-Reply-To: <8d3e2cc3-d4fd-6c84-e136-aef593b5ea4d@solarflare.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" 30/04/2018 15:07, Andrew Rybchenko: > On 04/30/2018 01:38 PM, Anatoly Burakov wrote: > > At hugepage info initialization, EAL takes out a write lock on > > hugetlbfs directories, and drops it after the memory init is > > finished. However, in non-legacy mode, if "-m" or "--socket-mem" > > switches are passed, this leads to a deadlock because EAL tries > > to allocate pages (and thus take out a write lock on hugedir) > > while still holding a separate hugedir write lock in EAL. > > > > Fix it by checking if write lock in hugepage info is active, and > > not trying to lock the directory if the hugedir fd is valid. > > > > Fixes: 1a7dc2252f28 ("mem: revert to using flock and add per-segment lockfiles") > > Cc: anatoly.burakov@intel.com > > > > Signed-off-by: Anatoly Burakov Tested-by: Maxime Coquelin Tested-by: Shahaf Shuler > Tested-by: Andrew Rybchenko Applied, thanks