mm: Implement folio_remove_rmap_range()
Like page_remove_rmap() but batch-removes the rmap for a range of pages
belonging to a folio. This can provide a small speedup due to less
manipuation of the various counters. But more crucially, if removing the
rmap for all pages of a folio in a batch, there is no need to
(spuriously) add it to the deferred split list, which saves significant
cost when there is contention for the split queue lock.
All contained pages are accounted using the order-0 folio (or base page)
scheme when nr_pages != -1. Else the whole folio is treated as being
PMD-mapped and is accounted using the compound scheme.
page_remove_rmap() is refactored as a simple wrapper around
folio_remove_rmap_range(), passing nr_pages = -1 to indicate the
compound case.
Signed-off-by:
Ryan Roberts <ryan.roberts@arm.com>
Loading
Please register or sign in to comment