Re: [v3 0/3] Reduce TLB flushes under some specific conditions

From: Nadav Amit
Date: Mon Oct 30 2023 - 14:32:51 EST



> On Oct 30, 2023, at 7:55 PM, Dave Hansen <dave.hansen@xxxxxxxxx> wrote:
>
> !! External Email
>
> On 10/30/23 00:25, Byungchul Park wrote:
>> I'm suggesting a mechanism to reduce TLB flushes by keeping source and
>> destination of folios participated in the migrations until all TLB
>> flushes required are done, only if those folios are not mapped with
>> write permission PTE entries at all. I worked Based on v6.6-rc5.
>
> There's a lot of common overhead here, on top of the complexity in general:
>
> * A new page flag
> * A new cpumask_t in task_struct
> * A new zone list
> * Extra (temporary) memory consumption
>
> and the benefits are ... "performance improved a little bit" on one
> workload. That doesn't seem like a good overall tradeoff to me.

I almost forgot that I did (and embarrassingly did not follow) a TLB
flush deferring mechanism mechanism before [*], which was relatively
generic. I did not look at the migration case, but it could have been
relatively easily added - I think.

Feel free to plagiarize if you find it suitable. Note that some of
the patch-set is not relevant (e.g., 20/20 has already been fixed,
3/20 was merged.)

[*] https://lore.kernel.org/linux-mm/20210131001132.3368247-1-namit@xxxxxxxxxx/