Re: [PATCH v6 0/5] mm: batch TLB flushing for dirty folios in vmscan
From: Barry Song
Date: Sun Nov 15 2026 - 18:27:53 EST
On Mon, Nov 16, 2026 at 7:02 AM Barry Song (Xiaomi) <baohua@xxxxxxxxxx> wrote:
[...]
> > ---
>
> Hi Peng,
>
> Just a quick update: this patch is still on my radar. I ran a
> quick perf test while building the kernel. Without your patch,
> try_to_unmap_flush_dirty() accounted for 1.75% of CPU cycles.
>
> I guess there could be workloads where try_to_unmap_flush_dirty()
> accounts for an even larger share of CPU cycles.
>
> # Children Self Command Shared Object Symbol
> # ........ ........ ....... ................. ............................
> #
>
> 1.75% 0.01% cc1 [kernel.kallsyms] [.] try_to_unmap_flush_dirty
> |
> --1.74%--try_to_unmap_flush_dirty
It's also worth mentioning that 1.75% may look small because
most CPU time during a kernel build is spent in GCC. However,
relative to shrink_folio_list(), try_to_unmap_flush_dirty()
accounts for roughly 10% of the CPU cycles in my test, which
is quite significant.
The following shows the CPU hotspot distribution among the
functions called by shrink_folio_list() without your patch:
swap_writeout 56.93%
folio_referenced 21.76%
try_to_unmap_flush_dirty 9.60%
try_to_unmap 5.10%
folio_alloc_swap 2.80%
__remove_mapping 1.42%
free_unref_folios 0.46%
Other / self 1.93%
Thanks,
Barry