On Tue, Aug 27, 2019 at 4:57 PM Nadav Amit <na...@vmware.com> wrote: > > > On Aug 27, 2019, at 4:07 PM, Andy Lutomirski <l...@kernel.org> wrote: > > > > On Fri, Aug 23, 2019 at 11:13 PM Nadav Amit <na...@vmware.com> wrote: > >> When a shootdown is initiated, the initiating CPU has cycles to burn as > >> it waits for the responding CPUs to receive the IPI and acknowledge it. > >> In these cycles it is better to flush the user page-tables using > >> INVPCID, instead of deferring the TLB flush. > >> > >> The best way to figure out whether there are cycles to burn is arguably > >> to expose from the SMP layer when an acknowledgment is received. > >> However, this would break some abstractions. > >> > >> Instead, use a simpler solution: the initiating CPU of a TLB shootdown > >> would not defer PTI flushes. It is not always a win, relatively to > >> deferring user page-table flushes, but it prevents performance > >> regression. > >> > >> Signed-off-by: Nadav Amit <na...@vmware.com> > >> --- > >> arch/x86/include/asm/tlbflush.h | 1 + > >> arch/x86/mm/tlb.c | 10 +++++++++- > >> 2 files changed, 10 insertions(+), 1 deletion(-) > >> > >> diff --git a/arch/x86/include/asm/tlbflush.h > >> b/arch/x86/include/asm/tlbflush.h > >> index da56aa3ccd07..066b3804f876 100644 > >> --- a/arch/x86/include/asm/tlbflush.h > >> +++ b/arch/x86/include/asm/tlbflush.h > >> @@ -573,6 +573,7 @@ struct flush_tlb_info { > >> unsigned int initiating_cpu; > >> u8 stride_shift; > >> u8 freed_tables; > >> + u8 shootdown; > > > > I find the name "shootdown" to be confusing. How about "more_than_one_cpu”? > > I think the current semantic is more of “includes remote cpus”. How about > calling it “local_only”, and negating its value?
Sure.