Re: [PATCH 4/7] x86,tlb: make lazy TLB mode lazier

From: Andy Lutomirski
Date: Thu Jul 19 2018 - 13:19:23 EST


On Thu, Jul 19, 2018 at 10:15 AM, Rik van Riel <riel@xxxxxxxxxxx> wrote:
>
>
> Given that CPUs in lazy TLB mode stay part of the mm_cpumask,
> that WARN_ON seems misplaced. You are right though, that the
> mm_cpumask alone should provide enough information for us to
> avoid a need for both tsk->active_mm and the refcounting.
>

If you do this extra shootdown after freeing pagetables, it would be
odd if mm_cpumask() wasn't empty. But you're right, the warn is
probably silly. And if you move it into arch_exit_mmap(), the warn is
definitely wrong.

>
> Does all that make sense? Basically, as I understand it, the
> expensive atomic ops you're seeing are all pointless because they're
> enabling an optimization that hasn't actually worked for a long time,
> if ever.
>
>
> Our benchmark results suggest that lazy TLB mode works, and makes
> a measurable performance difference. Getting rid of the atomic ops
> should make it a little better, though :)
>

I'm not saying lazy mode is useless. I'm saying that active_mm isn't
needed for x86's lazy mode :)