Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1750731imm; Mon, 3 Sep 2018 08:28:50 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYZ0OSgKYnzVoYiyBPYWWEo3h3AJlKFeDZpCf5YY52+1uahK6FuUZvFiPdjSyLnDjEarXwH X-Received: by 2002:a63:cd4c:: with SMTP id a12-v6mr27114405pgj.15.1535988530720; Mon, 03 Sep 2018 08:28:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535988530; cv=none; d=google.com; s=arc-20160816; b=Sk00ez0oHnfsB2RLSZrU6rFx55WUoVN8T8rfbcEvP5iZ9n9LveV8FHKLHcj2ltlSOH FG96Jbh+JzEn8mrSOV3P1X0sIcUy+UdRBwK6G3/DnaZsB6cDcdmGSEn7oPYrv0EB9oCg dulP5vXmf/5p7oDC3LgVWC0iwza8fPw9eSHIYpmPZcxcHh+Qjv0e+L0Iv9cS09jVH+Rf LWSxUrv5odFBlreulAfXbbMrokYDxeBwMHCtfIMxZAViW0wyCEx9LZRqf0ZtjZHeLZY6 kY1CYbIEj0MZ4VOK+Gr9u+BkjM3uXWH0zUFmhApqn/UjSyfnl3deKug6Rb/XhlMezQVE vCaA== 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:arc-authentication-results; bh=Z0K6ghPcBW/RR4qGX85xiMEjvbxJhO+VZoNTofcUY9o=; b=z4Ip6ZdsNwgyM/iLi06BL5aggoRoxCvGDsSosKFBHW2arnNzWl1gdrmK/oHZSn56Co wTEzax3ndEha71kRXRb7LX/dcZ806yxGi14p/VfXef2Kjrn5wrpaDeaGmWjhT638BEpE 0fzalgGCxKnotl6sFJ2cKYMuj2wtxrQ2orv0OYxqcHKo5b8tYD/uALu9Gk7LlwbvEszs ZnyQ20x90a49nMfu8c0HvAsaU7oyvlI/wE3SZFk1bqMNak2XVeZGYe1UO+DaxCVO0FdA fVXZjjefBRwWwJy28WXfhwYQApr1fW3kSpowwdBLXITQi1J6zCxhVQTsY+rJHMkU5ku1 NAYg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j64-v6si16597839pgc.88.2018.09.03.08.28.33; Mon, 03 Sep 2018 08:28:50 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727296AbeICTr6 (ORCPT + 99 others); Mon, 3 Sep 2018 15:47:58 -0400 Received: from mga02.intel.com ([134.134.136.20]:55234 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727136AbeICTr6 (ORCPT ); Mon, 3 Sep 2018 15:47:58 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Sep 2018 08:27:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,325,1531810800"; d="scan'208";a="88605023" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.126]) by orsmga002.jf.intel.com with ESMTP; 03 Sep 2018 08:26:16 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id 1277E301B65; Mon, 3 Sep 2018 08:26:16 -0700 (PDT) Date: Mon, 3 Sep 2018 08:26:16 -0700 From: Andi Kleen To: Linus Torvalds Cc: jsteckli@amazon.de, David Woodhouse , Konrad Rzeszutek Wilk , juerg.haefliger@hpe.com, deepa.srinivasan@oracle.com, Jim Mattson , Andrew Cooper , Linux Kernel Mailing List , Boris Ostrovsky , linux-mm , Thomas Gleixner , joao.m.martins@oracle.com, pradeep.vincent@oracle.com, Khalid Aziz , kanth.ghatraju@oracle.com, Liran Alon , Kees Cook , Kernel Hardening , chris.hyser@oracle.com, Tyler Hicks , John Haxby , Jon Masters Subject: Re: Redoing eXclusive Page Frame Ownership (XPFO) with isolated CPUs in mind (for KVM to isolate its guests per CPU) Message-ID: <20180903152616.GE27886@tassilo.jf.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 01, 2018 at 02:38:43PM -0700, Linus Torvalds wrote: > On Fri, Aug 31, 2018 at 12:45 AM Julian Stecklina wrote: > > > > I've been spending some cycles on the XPFO patch set this week. For the > > patch set as it was posted for v4.13, the performance overhead of > > compiling a Linux kernel is ~40% on x86_64[1]. The overhead comes almost > > completely from TLB flushing. If we can live with stale TLB entries > > allowing temporary access (which I think is reasonable), we can remove > > all TLB flushing (on x86). This reduces the overhead to 2-3% for > > kernel compile. > > I have to say, even 2-3% for a kernel compile sounds absolutely horrendous. > > Kernel bullds are 90% user space at least for me, so a 2-3% slowdown > from a kernel is not some small unnoticeable thing. Also the problem is that depending on the workload everything may fit into the TLBs, so the temporary stale TLB entries may be around for a long time. Modern CPUs have very large TLBs, and good LRU policies. For the kernel entries with global bit set and which are used for something there may be no reason ever to evict. Julian, I think you would need at least some quantitative perfmon data about TLB replacement rates in the kernel to show that it's "reasonable" instead of hand waving. Most likely I suspect you would need a low frequency regular TLB flush for the global entries at least, which will increase the overhead again. -Andi