From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D19CCC7618B for ; Fri, 26 Jul 2019 07:28:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AD573206BF for ; Fri, 26 Jul 2019 07:28:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726470AbfGZH2Z (ORCPT ); Fri, 26 Jul 2019 03:28:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:46750 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725864AbfGZH2Y (ORCPT ); Fri, 26 Jul 2019 03:28:24 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 18647AF47; Fri, 26 Jul 2019 07:28:23 +0000 (UTC) Subject: Re: [PATCH v3 4/9] x86/mm/tlb: Flush remote and local TLBs concurrently To: Nadav Amit , Andy Lutomirski , Dave Hansen Cc: Borislav Petkov , Peter Zijlstra , Sasha Levin , x86@kernel.org, Thomas Gleixner , virtualization@lists.linux-foundation.org, xen-devel@lists.xenproject.org, Haiyang Zhang , "K. Y. Srinivasan" , Stephen Hemminger , Boris Ostrovsky , Ingo Molnar , Paolo Bonzini , kvm@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190719005837.4150-1-namit@vmware.com> <20190719005837.4150-5-namit@vmware.com> From: Juergen Gross Message-ID: <3fc06d95-5f17-4642-cd91-49a0f70057c0@suse.com> Date: Fri, 26 Jul 2019 09:28:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190719005837.4150-5-namit@vmware.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19.07.19 02:58, Nadav Amit wrote: > To improve TLB shootdown performance, flush the remote and local TLBs > concurrently. Introduce flush_tlb_multi() that does so. Introduce > paravirtual versions of flush_tlb_multi() for KVM, Xen and hyper-v (Xen > and hyper-v are only compile-tested). > > While the updated smp infrastructure is capable of running a function on > a single local core, it is not optimized for this case. The multiple > function calls and the indirect branch introduce some overhead, and > might make local TLB flushes slower than they were before the recent > changes. > > Before calling the SMP infrastructure, check if only a local TLB flush > is needed to restore the lost performance in this common case. This > requires to check mm_cpumask() one more time, but unless this mask is > updated very frequently, this should impact performance negatively. > > Cc: "K. Y. Srinivasan" > Cc: Haiyang Zhang > Cc: Stephen Hemminger > Cc: Sasha Levin > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: Borislav Petkov > Cc: x86@kernel.org > Cc: Juergen Gross > Cc: Paolo Bonzini > Cc: Dave Hansen > Cc: Andy Lutomirski > Cc: Peter Zijlstra > Cc: Boris Ostrovsky > Cc: linux-hyperv@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Cc: virtualization@lists.linux-foundation.org > Cc: kvm@vger.kernel.org > Cc: xen-devel@lists.xenproject.org > Signed-off-by: Nadav Amit > --- > arch/x86/hyperv/mmu.c | 10 +++--- > arch/x86/include/asm/paravirt.h | 6 ++-- > arch/x86/include/asm/paravirt_types.h | 4 +-- > arch/x86/include/asm/tlbflush.h | 8 ++--- > arch/x86/include/asm/trace/hyperv.h | 2 +- > arch/x86/kernel/kvm.c | 11 +++++-- > arch/x86/kernel/paravirt.c | 2 +- > arch/x86/mm/tlb.c | 47 ++++++++++++++++++--------- > arch/x86/xen/mmu_pv.c | 11 +++---- > include/trace/events/xen.h | 2 +- > 10 files changed, 62 insertions(+), 41 deletions(-) Xen and paravirt parts: Reviewed-by: Juergen Gross Juergen