[RFC PATCH 13/16] mm/madvise: batch tlb flushes for process_madvise(MADV_FREE)

SeongJae Park posted 16 patches 9 months, 2 weeks ago
There is a newer version of this series
[RFC PATCH 13/16] mm/madvise: batch tlb flushes for process_madvise(MADV_FREE)
Posted by SeongJae Park 9 months, 2 weeks ago
MADV_FREE internal logic can be invoked with batching tlb flushes.
Update vector_madvise(), which is called for process_madvise(), to use
that in the efficient way, by passing an mmu_gather object that it
initializes before starting the work, and flushing the tlb entries at
once after all the internal works are done.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 mm/madvise.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/madvise.c b/mm/madvise.c
index efa4184d6cf5..f1beadb6176a 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -968,7 +968,8 @@ static long madvise_dontneed_free(struct vm_area_struct *vma,
 		return madvise_dontneed_single_vma(
 				madv_behavior->tlb, vma, start, end);
 	else if (behavior == MADV_FREE)
-		return madvise_free_single_vma(NULL, vma, start, end);
+		return madvise_free_single_vma(
+				madv_behavior->tlb, vma, start, end);
 	else
 		return -EINVAL;
 }
-- 
2.39.5