Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp855562imm; Wed, 18 Jul 2018 11:53:30 -0700 (PDT) X-Google-Smtp-Source: AAOMgpebRR1FrquT76CocsUPUogdmJxSxKB8ZfjeaOzWiItPNNIjiV0X7DlC2I/EKtQ626cnfEGa X-Received: by 2002:a65:5641:: with SMTP id m1-v6mr7057348pgs.246.1531940010574; Wed, 18 Jul 2018 11:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531940010; cv=none; d=google.com; s=arc-20160816; b=CoP7+eY2QJmRPlUn3z46aYbzzz2S033CdCmqEjk5KvxjhC1ZSgK+K/ueISKWOdkdFM gnJablLdakGgc/hZQOWnNgDVgrk+XjYvKQwDKkBXwPqb3ImdTX9ipazFcy57oLNREjpL YX84ucBk/FSc0drxULUFhfLjICc+CNpOsnL15n5ebFiw4cV4aGV63HK4MrNSP56KfSRy RTyPj7GQFdmT/mfDZDMqPHk/hSIPVmpGo9JNpoUT2XgFl7hjPMIdDzswpq6zCGY/Kodk L53DZsjpB7uBTL+Kdx3KVZO7k5DIvFzu2B+XAgv7KvfkTT/joMx75RoSU9yhnagwzQOq siLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:arc-authentication-results; bh=1IF84y0fL+EbaTT78aEiPbmklmGq/RDX6+5B0Yl7sbc=; b=fo8V0dRXq8b/mW1ZkX6ZTP5vzh+c7FOa5bKAhns3vCgDyONIX7diqXY34n3t2qpVgc VvwmHOTLg9XvH4RlEWHX7e4qICDdo5nood/d7h7ivgW6buKuQXwUODX51pzXO5cz7ROh 8L7zkDDUnhoT2zfi5gD1FJeUMn5XZWnzOODxkrojdx5Wd+Fqqhk8nd8J1pMpTHcaXBZy Fod+lHmmh4g/mYOWkWAcW1h/We8Uaf3QCm/cwW6kO2nYbeCSgA4H5CUFbKRANZZT/Zau lOpAOPwW27w+RgexGA5FZFIEMIZFuME0r8NZkHUk9bos7uDygtU83UBJIyS/ChZNMkSC VQ7Q== ARC-Authentication-Results: i=1; mx.google.com; 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 c197-v6si4037196pfc.74.2018.07.18.11.53.15; Wed, 18 Jul 2018 11:53:30 -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; 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 S1729235AbeGRTbO convert rfc822-to-8bit (ORCPT + 99 others); Wed, 18 Jul 2018 15:31:14 -0400 Received: from shelob.surriel.com ([96.67.55.147]:53688 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726909AbeGRTbO (ORCPT ); Wed, 18 Jul 2018 15:31:14 -0400 Received: from [2620:10d:c091:200::1:ca15] (helo=[IPv6:2620:10d:c0a3:10fb:4c:7ee9:b6e2:d1d5]) by shelob.surriel.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ffrYC-0008I7-Fu; Wed, 18 Jul 2018 14:51:48 -0400 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: [tip:x86/mm] x86/mm/tlb: Make lazy TLB mode lazier From: Rik van Riel In-Reply-To: <20180718182359.GW2494@hirez.programming.kicks-ass.net> Date: Wed, 18 Jul 2018 14:51:45 -0400 Cc: songliubraving@fb.com, linux-kernel@vger.kernel.org, dave.hansen@intel.com, hpa@zytor.com, tglx@linutronix.de, mingo@kernel.org, torvalds@linux-foundation.org, linux-tip-commits@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: <477353D9-BA10-4AAB-ACC4-DDFDAE63895B@surriel.com> References: <20180716190337.26133-5-riel@surriel.com> <20180717113330.GU2476@hirez.programming.kicks-ass.net> <08AC2AF2-17DE-4416-BBBD-B6B950D20906@surriel.com> <20180718160007.GS2494@hirez.programming.kicks-ass.net> <081E558D-DB34-4A18-A35C-896BC47F6EBA@surriel.com> <20180718182359.GW2494@hirez.programming.kicks-ass.net> To: Peter Zijlstra X-Mailer: Apple Mail (2.3445.9.1) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jul 18, 2018, at 2:23 PM, Peter Zijlstra wrote: > > On Wed, Jul 18, 2018 at 01:22:19PM -0400, Rik van Riel wrote: >>> On Jul 18, 2018, at 12:00 PM, Peter Zijlstra wrote: > >>> Also, I don't suppose you've looked at the paravirt instances of >>> flush_tlb_other() ? They don't elide the flushes because of lazy. >> >> Let me look at those now :) > > > >> kvm_flush_tlb_other takes out preempted VCPUs from the flush mask, >> before calling native_flush_tlb_others, so it should get the optimization >> automatically. > > Ah, ok. I wasn't entirely sure the new lazy was purely for the idle > case. But yes, the KVM paravirt thing should get the idle case right. > Not just idle, but also running in kernel threads like ksoftirqd, kworker, kswapd, etc. However, kvm_flush_tlb_other calls native_flush_tlb_other, so it should get that optimization automatically from my patch series.