Messages in this thread | | | Date | Thu, 25 Mar 2021 11:37:30 -0300 | From | Jason Gunthorpe <> | Subject | Re: [PATCH 3/3] mm/devmap: Remove pgmap accounting in the get_user_pages_fast() path |
| |
On Wed, Mar 17, 2021 at 09:08:28PM -0700, Dan Williams wrote: > Now that device-dax and filesystem-dax are guaranteed to unmap all user > mappings of devmap / DAX pages before tearing down the 'struct page' > array, get_user_pages_fast() can rely on its traditional synchronization > method "validate_pte(); get_page(); revalidate_pte()" to catch races with > device shutdown. Specifically the unmap guarantee ensures that gup-fast > either succeeds in taking a page reference (lock-less), or it detects a > need to fall back to the slow path where the device presence can be > revalidated with locks held. > > Reported-by: Jason Gunthorpe <jgg@ziepe.ca> > Cc: Christoph Hellwig <hch@lst.de> > Cc: Shiyang Ruan <ruansy.fnst@fujitsu.com> > Cc: Vishal Verma <vishal.l.verma@intel.com> > Cc: Dave Jiang <dave.jiang@intel.com> > Cc: Ira Weiny <ira.weiny@intel.com> > Cc: Matthew Wilcox <willy@infradead.org> > Cc: Jan Kara <jack@suse.cz> > Cc: Andrew Morton <akpm@linux-foundation.org> > Signed-off-by: Dan Williams <dan.j.williams@intel.com> > --- > mm/gup.c | 38 ++++++++++++++++---------------------- > 1 file changed, 16 insertions(+), 22 deletions(-)
I'm happy to see this, and it is really the right thing that PTEs are properly removed before anything happens to the pages under them.
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Jason
| |