[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190821180200.GA5965@iweiny-DESK2.sc.intel.com>
Date: Wed, 21 Aug 2019 11:02:00 -0700
From: Ira Weiny <ira.weiny@...el.com>
To: Jason Gunthorpe <jgg@...pe.ca>
Cc: Dave Chinner <david@...morbit.com>, Jan Kara <jack@...e.cz>,
Andrew Morton <akpm@...ux-foundation.org>,
Dan Williams <dan.j.williams@...el.com>,
Matthew Wilcox <willy@...radead.org>,
Theodore Ts'o <tytso@....edu>,
John Hubbard <jhubbard@...dia.com>,
Michal Hocko <mhocko@...e.com>, linux-xfs@...r.kernel.org,
linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-nvdimm@...ts.01.org,
linux-ext4@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [RFC PATCH v2 00/19] RDMA/FS DAX truncate proposal V1,000,002 ;-)
On Tue, Aug 20, 2019 at 08:55:15AM -0300, Jason Gunthorpe wrote:
> On Tue, Aug 20, 2019 at 11:12:10AM +1000, Dave Chinner wrote:
> > On Mon, Aug 19, 2019 at 09:38:41AM -0300, Jason Gunthorpe wrote:
> > > On Mon, Aug 19, 2019 at 07:24:09PM +1000, Dave Chinner wrote:
> > >
> > > > So that leaves just the normal close() syscall exit case, where the
> > > > application has full control of the order in which resources are
> > > > released. We've already established that we can block in this
> > > > context. Blocking in an interruptible state will allow fatal signal
> > > > delivery to wake us, and then we fall into the
> > > > fatal_signal_pending() case if we get a SIGKILL while blocking.
> > >
> > > The major problem with RDMA is that it doesn't always wait on close() for the
> > > MR holding the page pins to be destoyed. This is done to avoid a
> > > deadlock of the form:
> > >
> > > uverbs_destroy_ufile_hw()
> > > mutex_lock()
> > > [..]
> > > mmput()
> > > exit_mmap()
> > > remove_vma()
> > > fput();
> > > file_operations->release()
> >
> > I think this is wrong, and I'm pretty sure it's an example of why
> > the final __fput() call is moved out of line.
>
> Yes, I think so too, all I can say is this *used* to happen, as we
> have special code avoiding it, which is the code that is messing up
> Ira's lifetime model.
>
> Ira, you could try unraveling the special locking, that solves your
> lifetime issues?
Yes I will try to prove this out... But I'm still not sure this fully solves
the problem.
This only ensures that the process which has the RDMA context (RDMA FD) is safe
with regard to hanging the close for the "data file FD" (the file which has
pinned pages) in that _same_ process. But what about the scenario.
Process A has the RDMA context FD and data file FD (with lease) open.
Process A uses SCM_RIGHTS to pass the RDMA context FD to Process B.
Process A attempts to exit (hangs because data file FD is pinned).
Admin kills process A. kill works because we have allowed for it...
Process B _still_ has the RDMA context FD open _and_ therefore still holds the
file pins.
Truncation still fails.
Admin does not know which process is holding the pin.
What am I missing?
Ira
Powered by blists - more mailing lists