Re: [RFC PATCH 00/16] mm/madvise: batch tlb flushes for MADV_DONTNEED and MADV_FREE

From: SeongJae Park
Date: Wed Mar 05 2025 - 18:04:27 EST


On Wed, 5 Mar 2025 22:36:45 +0200 Nadav Amit <nadav.amit@xxxxxxxxx> wrote:

>
> > On 5 Mar 2025, at 20:15, SeongJae Park <sj@xxxxxxxxxx> wrote:
> >
> > For MADV_DONTNEED[_LOCKED] or MADV_FREE madvise requests, tlb flushes
> > can happen for each vma of the given address ranges. Because such tlb
> > flushes are for address ranges of same process, doing those in a batch
> > is more efficient while still being safe. Modify madvise() and
> > process_madvise() entry level code path to do such batched tlb flushes,
> > while the internal unmap logics do only gathering of the tlb entries to
> > flush.
>
> I made some related (similar?) patches in the past. You can see if you
> find something useful in the discussion there. I think your version avoids
> some of the “mistakes” I made.

Thank you for sharing this! I sure I can learn and use many things from this
work and previous discussions.

>
> [1] https://lore.kernel.org/all/20210926161259.238054-1-namit@xxxxxxxxxx/T/#m23ccd29bad04a963c4d8c64ec3581f7c301c7806


Thanks,
SJ