]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/madvise: batch tlb flushes for MADV_FREE
authorSeongJae Park <sj@kernel.org>
Thu, 10 Apr 2025 00:00:20 +0000 (17:00 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 12 May 2025 00:48:27 +0000 (17:48 -0700)
commit01bef02bf9301ea6c255b0daa38356e07719dd69
treea86be65236a02978ca3477d73e497c3678f4a176
parent066c770437835d2bd2072bd2c88a71fcbbd5ccb3
mm/madvise: batch tlb flushes for MADV_FREE

MADV_FREE handling for [process_]madvise() flushes tlb for each vma of
each address range.  Update the logic to do tlb flushes in a batched way.
Initialize an mmu_gather object from do_madvise() and vector_madvise(),
which are the entry level functions for [process_]madvise(), respectively.
And pass those objects to the function for per-vma work, via
madvise_behavior struct.  Make the per-vma logic not flushes tlb on their
own but just saves the tlb entries to the received mmu_gather object.
Finally, the entry level functions flush the tlb entries that gathered for
the entire user request, at once.

Link: https://lkml.kernel.org/r/20250410000022.1901-3-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/madvise.c