]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: replace xa_get_order with xas_get_order where appropriate
authorShakeel Butt <shakeel.butt@linux.dev>
Fri, 6 Sep 2024 23:05:12 +0000 (16:05 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 9 Sep 2024 23:39:17 +0000 (16:39 -0700)
commit354a595a4a4d9dfc0d3e5703c6c5520e6c2f52d8
treee5f4878255d3c472123f8ebe2b0101625489586e
parent1930c6ad93ad01f82bb7965bbc04eb5a763f856d
mm: replace xa_get_order with xas_get_order where appropriate

The tracing of invalidation and truncation operations on large files
showed that xa_get_order() is among the top functions where kernel spends
a lot of CPUs.  xa_get_order() needs to traverse the tree to reach the
right node for a given index and then extract the order of the entry.
However it seems like at many places it is being called within an already
happening tree traversal where there is no need to do another traversal.
Just use xas_get_order() at those places.

Link: https://lkml.kernel.org/r/20240906230512.124643-1-shakeel.butt@linux.dev
Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Nhat Pham <nphamcs@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/filemap.c
mm/shmem.c