mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nadav Amit <namit@vmware.com>
To: Andy Lutomirski <luto@kernel.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
	X86 ML <x86@kernel.org>, LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>
Subject: Re: [RFC PATCH v2 3/3] x86/mm/tlb: Avoid deferring PTI flushes on shootdown
Date: Tue, 27 Aug 2019 23:57:27 +0000	[thread overview]
Message-ID: <F9CA7AFA-D54B-4458-8248-CA52584C13CD@vmware.com> (raw)
In-Reply-To: <CALCETrXjqa6pWpAgh7v-sttOwY0V2RUqQ_Vs-JQr7nFDYvrBpQ@mail.gmail.com>

> On Aug 27, 2019, at 4:07 PM, Andy Lutomirski <luto@kernel.org> wrote:
> 
> On Fri, Aug 23, 2019 at 11:13 PM Nadav Amit <namit@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 <namit@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?

  reply	other threads:[~2019-08-27 23:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-23 22:52 [RFC PATCH v2 0/3] x86/mm/tlb: Defer TLB flushes with PTI Nadav Amit
2019-08-23 22:52 ` [RFC PATCH v2 1/3] x86/mm/tlb: Change __flush_tlb_one_user interface Nadav Amit
2019-08-26  7:51   ` Juergen Gross
2019-08-26 16:38     ` Nadav Amit
2019-08-27  5:53       ` Juergen Gross
2019-08-23 22:52 ` [RFC PATCH v2 2/3] x86/mm/tlb: Defer PTI flushes Nadav Amit
2019-08-27 18:28   ` Dave Hansen
2019-08-27 19:46     ` Nadav Amit
2019-08-27 23:13   ` Andy Lutomirski
2019-08-27 23:55     ` Nadav Amit
2019-08-28  0:30       ` Andy Lutomirski
2019-08-23 22:52 ` [RFC PATCH v2 3/3] x86/mm/tlb: Avoid deferring PTI flushes on shootdown Nadav Amit
2019-08-27 23:07   ` Andy Lutomirski
2019-08-27 23:57     ` Nadav Amit [this message]
2019-08-28  0:30       ` Andy Lutomirski
2019-08-27 18:17 ` [RFC PATCH v2 0/3] x86/mm/tlb: Defer TLB flushes with PTI Dave Hansen
2019-09-03 15:17 ` Dave Hansen
2019-09-03 16:13   ` Nadav Amit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F9CA7AFA-D54B-4458-8248-CA52584C13CD@vmware.com \
    --to=namit@vmware.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®