[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrU96Pjw5AEy_Aju_hMkv=QdE3YVfx5aY24B8WwDqM1A9Q@mail.gmail.com>
Date: Thu, 30 May 2019 07:15:02 -0700
From: Andy Lutomirski <luto@...nel.org>
To: Zhenzhong Duan <zhenzhong.duan@...cle.com>
Cc: LKML <linux-kernel@...r.kernel.org>, srinivas.eeda@...cle.com,
Dave Hansen <dave.hansen@...ux.intel.com>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
X86 ML <x86@...nel.org>
Subject: Re: [PATCH] x86/mm/tlb: Do partial TLB flush when possible
On Thu, May 30, 2019 at 12:56 AM Zhenzhong Duan
<zhenzhong.duan@...cle.com> wrote:
>
> This is a small optimization to stale TLB flush, if there is one new TLB
> flush, let it choose to do partial or full flush. or else, the stale
> flush take over and do full flush.
I think this is invalid because:
>
> + if (unlikely(f->new_tlb_gen <= local_tlb_gen &&
> + local_tlb_gen + 1 == mm_tlb_gen)) {
> + /*
> + * For stale TLB flush request, if there will be one new TLB
> + * flush coming, we leave the work to the new IPI as it knows
> + * partial or full TLB flush to take, or else we do the full
> + * flush.
> + */
> + trace_tlb_flush(reason, 0);
> + return;
We do indeed know that the TLB will get flushed eventually, but we're
actually providing a stronger guarantee that the TLB will be
adequately flushed by the time we return. Otherwise, after
flush_tlb_mm_range(), there will be a window in which the TLB isn't
flushed yet.
Powered by blists - more mailing lists