[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190221225937.GS17500@ziepe.ca>
Date: Thu, 21 Feb 2019 15:59:37 -0700
From: Jason Gunthorpe <jgg@...pe.ca>
To: Jerome Glisse <jglisse@...hat.com>
Cc: Haggai Eran <haggaie@...lanox.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
Leon Romanovsky <leonro@...lanox.com>,
Doug Ledford <dledford@...hat.com>,
Artemy Kovalyov <artemyko@...lanox.com>,
Moni Shoua <monis@...lanox.com>,
Mike Marciniszyn <mike.marciniszyn@...el.com>,
Kaike Wan <kaike.wan@...el.com>,
Dennis Dalessandro <dennis.dalessandro@...el.com>,
Aviad Yehezkel <aviadye@...lanox.com>
Subject: Re: [PATCH 1/1] RDMA/odp: convert to use HMM for ODP
On Wed, Feb 20, 2019 at 05:29:24PM -0500, Jerome Glisse wrote:
> > >
> > > Yes it is safe, the hmm struct has its own refcount and mirror holds a
> > > reference on it, the mm struct itself has a reference on the mm
> > > struct.
> >
> > The issue here is that that hmm_mirror_unregister() must be a strong
> > fence that guarentees no callback is running or will run after
> > return. mmu_notifier_unregister did not provide that.
> >
> > I think I saw locking in hmm that was doing this..
>
> So pattern is:
> hmm_mirror_register(mirror);
>
> // Safe for driver to call within HMM with mirror no matter what
>
> hmm_mirror_unregister(mirror)
>
> // Driver must no stop calling within HMM, it would be a use after
> // free scenario
This statement is the opposite direction
I want to know that HMM doesn't allow any driver callbacks to be
running after unregister - because I am going to kfree mirror and
other memory touched by the driver callbacks.
Jason
Powered by blists - more mailing lists