mm/gup: Handle page split race more efficiently
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 7 Jan 2022 19:04:55 +0000 (14:04 -0500)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 17 Feb 2022 22:05:52 +0000 (17:05 -0500)
commit73ba530298ccebb1a0dd39e47a17c4cae62bc8ee
tree2d72b43fea6491b6d0a6f4e0d7457cf01cd05b30
parent62f66542c85c2c77ae7b4a2a0a14338b03f7fda6
mm/gup: Handle page split race more efficiently

If we hit the page split race, the current code returns NULL which will
presumably trigger a retry under the mmap_lock.  This isn't necessary;
we can just retry the compound_head() lookup.  This is a very minor
optimisation of an unlikely path, but conceptually it matches (eg)
the page cache RCU-protected lookup.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: William Kucharski <william.kucharski@oracle.com>
mm/gup.c