filemap: add filemap_map_folio_range()
authorYin Fengwei <fengwei.yin@intel.com>
Wed, 2 Aug 2023 15:14:02 +0000 (16:14 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 24 Aug 2023 23:20:26 +0000 (16:20 -0700)
commitde74976eb65151a2f568e477fc2e0032df5b22b4
treefa36b6e03679eeaad213a391dde09527a9d665bf
parent9f1f5b60e76d44fa85fef6970b7477f72d3999eb
filemap: add filemap_map_folio_range()

filemap_map_folio_range() maps partial/full folio.  Comparing to original
filemap_map_pages(), it updates refcount once per folio instead of per
page and gets minor performance improvement for large folio.

With a will-it-scale.page_fault3 like app (change file write fault testing
to read fault testing.  Trying to upstream it to will-it-scale at [1]),
got 2% performance gain on a 48C/96T Cascade Lake test box with 96
processes running against xfs.

[1]: https://github.com/antonblanchard/will-it-scale/pull/37

Link: https://lkml.kernel.org/r/20230802151406.3735276-35-willy@infradead.org
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/filemap.c