Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2317917imm; Fri, 7 Sep 2018 14:33:03 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ9i59jf62MRzJtKG+mhTnPP8j3hz6R7ivgVBT75NRhlU4R9EoG3xSPRKkhWnq97P77Fg+1 X-Received: by 2002:a17:902:59cf:: with SMTP id d15-v6mr10197136plj.184.1536355983323; Fri, 07 Sep 2018 14:33:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536355983; cv=none; d=google.com; s=arc-20160816; b=ZeTPIDkDx6IOcTU5W8y85B+wkQ6MxRQwnN8Pjp274igT3KtW6hIGyO73QOuHsQI1nS jG1aE2BSG6TjfJWoh7//RVyaRGa/Wpeh++qlvmDSCcd+TJAoVyvsTkNI/To6rCT3fnlM 1/1htboYHu/AuyspcFlwpgbK+8Sdz/u/Q1ecOETujh4Q7mDyDyLusEOK8rO9lrR2OoJR lXi56bZjoXBQhlTBHCkxCifAI8VcoRGCxMdz7JMABtV0NQfxM1W+ej20mLF7P1U6TSId Gm6C81mKKCLNeiVNj28CTg5nAfsBSD3r1KNEa1RT4OER6KIHsYU8lFfd8VLM5yfr/0+4 VucQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature; bh=ELuhaeRrH1vi0zwKqxYfMNq5b292N1qzRMsQ/4Wy+Ig=; b=pv3JmJN+H4eYnFDCeAPHXdOdw87QHNpuoTvDh59Yi/Cvzxc7/HA1BfPw79PWcPBdNp y6e2KH9OoPhUNcMw1sFkHCb4mDfg3BTUTjF8FZwyyxKDqm3e6YCBZSPWORvZa9JYM1By XXeOSEj+E1i69w4fbqoLFdC9OmlcleZINwDe/JvHZmTnD/grZ2xoZZDp1aswlwHcuKoA 8SwJm5GDrd11IzfYN92Zgc4N+hKHyppC1q4L0WP4fYThSVvL44Zl/ycqT92rKSYBNjR6 gCQy/qRUU4uMtsHbvwRonBeeVG63b2tIB1Fw0dfCdwKHPpg9bVzn+27ApLYDJcuHdOgA LNvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=H6Dsll6j; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g4-v6si8779854pll.384.2018.09.07.14.32.47; Fri, 07 Sep 2018 14:33:03 -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=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=H6Dsll6j; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729785AbeIHCNu (ORCPT + 99 others); Fri, 7 Sep 2018 22:13:50 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:42832 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728116AbeIHCNt (ORCPT ); Fri, 7 Sep 2018 22:13:49 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w87LIgTO041626; Fri, 7 Sep 2018 21:30:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=ELuhaeRrH1vi0zwKqxYfMNq5b292N1qzRMsQ/4Wy+Ig=; b=H6Dsll6jgPhQZndHt84H4g+l6Sv4tfCHbIbbUaBmAciFf5aI8vyDUJQuEWJ7QUrxZp4u A29mSG1Rohtqs4e9BIH48Qk9R9ybSx5PwKOzx5Cdw8UzOZ36S8smU5p2QhVhh+lzOGp1 LiiNK+n5Pm/tB6zQZ0OMi5BBgsAjJllpePxwF5JVxxi/Wkaop42YtMt8n3qnb2/oZSoq DdgQpcvSG7cJxtdIgp0kU6H144ClvbjZCzqmg1dRtJ7v3I9GkfWzgOGZQDzaV7jE4mCc q+1x3ar3DHwfmJ1oX3H6whcFxfeScJi7Cq4uu8AE/N27ur834SRRs/cL70Lya9HkiEvJ Ng== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2m7kdr4pq4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Sep 2018 21:30:17 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w87LUFBS032468 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 7 Sep 2018 21:30:15 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w87LUD7s029850; Fri, 7 Sep 2018 21:30:13 GMT Received: from [192.168.1.16] (/24.9.64.241) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 07 Sep 2018 14:30:12 -0700 Subject: Re: Redoing eXclusive Page Frame Ownership (XPFO) with isolated CPUs in mind (for KVM to isolate its guests per CPU) To: Julian Stecklina , Linus Torvalds Cc: 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, Andi Kleen , kanth.ghatraju@oracle.com, Liran Alon , Kees Cook , Kernel Hardening , chris.hyser@oracle.com, Tyler Hicks , John Haxby , Jon Masters References: From: Khalid Aziz Organization: Oracle Corp Message-ID: <80a75259-e38b-be94-dc4a-827eddfae931@oracle.com> Date: Fri, 7 Sep 2018 15:30:10 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9009 signatures=668708 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809070210 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/30/2018 10:00 AM, Julian Stecklina wrote: > Hey everyone, > > On Mon, 20 Aug 2018 15:27 Linus Torvalds wrote: >> On Mon, Aug 20, 2018 at 3:02 PM Woodhouse, David wrote: >>> >>> It's the *kernel* we don't want being able to access those pages, >>> because of the multitude of unfixable cache load gadgets. >> >> Ahh. >> >> I guess the proof is in the pudding. Did somebody try to forward-port >> that patch set and see what the performance is like? > > 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. > > There were no problems in forward-porting the patch set to master. > You can find the result here, including a patch makes the TLB flushing > configurable: > http://git.infradead.org/users/jsteckli/linux-xpfo.git/shortlog/refs/heads/xpfo-master > > It survived some casual stress-ng runs. I can rerun the benchmarks on > this version, but I doubt there is any change. > >> It used to be just 500 LOC. Was that because they took horrible >> shortcuts? > > The patch is still fairly small. As for the horrible shortcuts, I let > others comment on that. Looks like the performance impact can be whole lot worse. On my test system with 2 Xeon Platinum 8160 (HT enabled) CPUs and 768 GB of memory, I am seeing very high penalty with XPFO when building 4.18.6 kernel sources with "make -j60": No XPFO patch XPFO patch(No TLB flush) XPFO(TLB Flush) sys time 52m 54.036s 55m 47.897s 434m 8.645s That is ~8% worse with TLB flush disabled and ~720% worse with TLB flush enabled. This test was with kernel sources being compiled on an ext4 filesystem. XPFO seems to affect ext2 even more. With ext2 filesystem, impact was ~18.6% and ~900%. -- Khalid