Re: [PATCH] x86,mm: only trim the mm_cpumask once a second

Rik van Riel
2024-12-04T16:07:41Z

On Wed, 2024-12-04 at 21:15 +0800, Oliver Sang wrote:
>
> we tested this patch, unfortunately, we found even bigger regression
> in our
> will-it-scale tests. and for another vm-scalability test, it also
> causes a
> little worse performance.
>
> we noticed there is the v2 for this patch, not sure if any
> significant changes
> which could impact performance? if so, please notify us and we could
> test
> further. thanks
>
> below is details.

Looking at the profile, it looks like:
1) switch_mm_irqs_off is somehow taking more
CPU time after these changes, despite
removing an unconditional atomic set_bit.
I have no good explanation for this.
2) Moving some overhead from the fast path
in the context switch patch (switch_mm_irqs_off)
to the slower path in flush_tlb_func isn't
right for the tlb_flush2 threaded test,
which basically only does madvise and
TLB flushes :)

However, I think we can reduce the overhead
in the TLB flush side a little more, by moving
the jiffies test from tlb_flush_func into the
calling unction flush_tlb_mm_range, so the
jiffies comparison is only ever done on the
calling CPU, not on all the CPUs that receive
the IPIs.

Let me send over a v3 in a little bit.