Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2671634imm; Fri, 20 Jul 2018 02:51:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcYF67V95CnBkMEZVTWfh7STdnEJbbOtRG1ov6NzxSkKcpexCI+V8EsHCBt/U61NMjKInAd X-Received: by 2002:a63:ee4e:: with SMTP id n14-v6mr1430012pgk.159.1532080318235; Fri, 20 Jul 2018 02:51:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532080318; cv=none; d=google.com; s=arc-20160816; b=BWlX93mlQcKWOLkSL6eJBPKJo2YC4I8n8UGUHbJ0sVNoGorQkcWWa7aJUpRHhlLMjG 5Pn88weBrOc+u5txLrQHXpEiyI8KcrL5j4l0vKUmw3lH2fpmtA5EwytoKzWbpWoPtlMG YS0vYMSCPhdRhsQS4zU2fAPx8YSVCGF7CYmhfmcZgX4JWinfosBPU1C75F0L4lz8DzZR bO/UEXE3z4yvLGglca4dCcHQt8PgGn7iF3rUAMurdV959MjPACTNP6bJdjynwz7iu3Wa mz6zUrmLuWJ5Q8Dr6+7djNiRIw2KQZR/aUJ/BEJzqyCWWWM3kefVB96BKOccNfhO6z3m wcRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=npyWeYAvaDwlL6CBTqUqUL1bgVZHIQT8rxIdgq3D37U=; b=NiiMznZ+qaEQnrudBwF3YSvw+Oin869qNI6Hs8Cc9VL4GLlY+QsOyZCguNnU3rWI7D eQQAMOliNqqWEfx6wB3X5htISlkD3rBttawZt5GUXww8iNQ6se2y3xTMg+Ml8sPXNazr OgbCccoJ90vWjvgXHcRsixn7BlohhJKyAgaO+emKpxBveglfG7dsUnsiMQPaIjXi1I3i 9erFSlN+z6xpMJFPKvnZ6yf6y2DphjQJEbiR7foLq5yI+2qwRRYnew7cWFcN0MFP49UI wE3+zisuj4vBZLBlU+R1b4hVDwo983kAPPupHhIOxL9KLJaCq6B+K8S+l4ezRrqMC0lW aSjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=wKbs4rll; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z137-v6si1382506pgz.144.2018.07.20.02.51.43; Fri, 20 Jul 2018 02:51:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=wKbs4rll; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728418AbeGTKg5 (ORCPT + 99 others); Fri, 20 Jul 2018 06:36:57 -0400 Received: from merlin.infradead.org ([205.233.59.134]:54666 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727156AbeGTKg5 (ORCPT ); Fri, 20 Jul 2018 06:36:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=npyWeYAvaDwlL6CBTqUqUL1bgVZHIQT8rxIdgq3D37U=; b=wKbs4rllj4iP8a5nPf2gecwSv lCbLHAOQdDbfdHHl2YzRzLBwZ1dZe/mHhe9KvxTSDQktsaHo4CPwmVggMBosaY4jUL9PUSsdVm0/j 2SabX8VD9xJaEj++QI+OfboomP2aN4h6Jb5MBjyfhb3/hEzRklBnyA4UZ0P+YJD5m7m37SdDMKa3P eLtPevCAmkrTS94AjZZ5brsr5ZAjTkldYyJMl5FgSUsA8falbY9D8iDFLbXQe4JqqrqacndjWgQyZ ndgOjNe/t42XOBX2fImwRwpJOmGqqHyVsmQYgd2kESxSMdiiBUDjBvz8/xhPLM9LShi4om7vq3ni+ zg9vVPuKg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fgS2A-0001aG-7V; Fri, 20 Jul 2018 09:49:10 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 7AD9E20277352; Fri, 20 Jul 2018 11:49:06 +0200 (CEST) Date: Fri, 20 Jul 2018 11:49:06 +0200 From: Peter Zijlstra To: Vitaly Kuznetsov Cc: Andy Lutomirski , Rik van Riel , Andy Lutomirski , LKML , X86 ML , Mike Galbraith , kernel-team , Ingo Molnar , Dave Hansen Subject: Re: [PATCH 4/7] x86,tlb: make lazy TLB mode lazier Message-ID: <20180720094906.GP2494@hirez.programming.kicks-ass.net> References: <20180716190337.26133-1-riel@surriel.com> <20180716190337.26133-5-riel@surriel.com> <87muumtjwd.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87muumtjwd.fsf@vitty.brq.redhat.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 20, 2018 at 10:02:10AM +0200, Vitaly Kuznetsov wrote: > Andy Lutomirski writes: > > > [I added PeterZ and Vitaly -- can you see any way in which this would > > break something obscure? I don't.] > > Thanks for CCing me, > > I don't see how this can break things either. At first glance, however, > I'm afraid we can add performance penalty to virtualized guests which > don't use native_flush_tlb_others() (Hyper-V, KVM): we will be reloading > CR3 without a need as we don't look at lazy mode in PV tlb flush > functions. > > We can either check to switch_mm_irqs_off() that > native_flush_tlb_others() is in use or teach PV tlb flush functions to > look at lazy mode too. As Rik noted elsewhere in the thread, kvm_flush_tlb_others() ends up calling native_tlb_flush_others() for all running vcpu threads. The Hyper-V thing is magical, we can't really do anything about it there. Let them worry about it.