mm: move more expensive part of XA setup out of mapping check
authorJens Axboe <axboe@kernel.dk>
Fri, 5 Nov 2021 20:37:13 +0000 (13:37 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 6 Nov 2021 20:30:34 +0000 (13:30 -0700)
commitf8ee8909ac818e555ef18b57b0ee4b9fd0478b82
tree9e086f771c7c0a799c1545a48a5995526edd5b29
parentd417b49fff3e2f21043c834841e8623a6098741d
mm: move more expensive part of XA setup out of mapping check

The fast path here is not needing any writeback, yet we spend time
setting up the xarray lookup data upfront.  Move the part that actually
needs to iterate the address space mapping into a separate helper,
saving ~30% of the time here.

Link: https://lkml.kernel.org/r/49f67983-b802-8929-edab-d807f745c9ca@kernel.dk
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/filemap.c