From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 21 Aug 2019 16:48:10 -0300 From: Jason Gunthorpe Subject: Re: [RFC PATCH v2 00/19] RDMA/FS DAX truncate proposal V1,000,002 ;-) Message-ID: <20190821194810.GI8653@ziepe.ca> References: <20190816190528.GB371@iweiny-DESK2.sc.intel.com> <20190817022603.GW6129@dread.disaster.area> <20190819063412.GA20455@quack2.suse.cz> <20190819092409.GM7777@dread.disaster.area> <20190819123841.GC5058@ziepe.ca> <20190820011210.GP7777@dread.disaster.area> <20190820115515.GA29246@ziepe.ca> <20190821180200.GA5965@iweiny-DESK2.sc.intel.com> <20190821181343.GH8653@ziepe.ca> <20190821185703.GB5965@iweiny-DESK2.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190821185703.GB5965@iweiny-DESK2.sc.intel.com> Sender: owner-linux-mm@kvack.org To: Ira Weiny Cc: Dave Chinner , Jan Kara , Andrew Morton , Dan Williams , Matthew Wilcox , Theodore Ts'o , John Hubbard , Michal Hocko , linux-xfs@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-nvdimm@lists.01.org, linux-ext4@vger.kernel.org, linux-mm@kvack.org List-ID: On Wed, Aug 21, 2019 at 11:57:03AM -0700, Ira Weiny wrote: > > Oh, I didn't think we were talking about that. Hanging the close of > > the datafile fd contingent on some other FD's closure is a recipe for > > deadlock.. > > The discussion between Jan and Dave was concerning what happens when a user > calls > > fd = open() > fnctl(...getlease...) > addr = mmap(fd...) > ib_reg_mr() > munmap(addr...) > close(fd) I don't see how blocking close(fd) could work. Write it like this: fd = open() uverbs = open(/dev/uverbs) fnctl(...getlease...) addr = mmap(fd...) ib_reg_mr() munmap(addr...) The order FD's are closed during sigkill is not deterministic, so when all the fputs happen during a kill'd exit we could end up blocking in close(fd) as close(uverbs) will come after in the close list. close(uverbs) is the thing that does the dereg_mr and releases the pin. We don't need complexity with dup to create problems. Jason