Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3553918imm; Thu, 17 May 2018 10:32:04 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpq7zU05oJ7zBZYYtfFDbXsf/z+qGjIEhVfTTugrGASi6ptSJM7coT2dkvuWQ6kCEIZVcRm X-Received: by 2002:a62:ee15:: with SMTP id e21-v6mr5998711pfi.203.1526578324819; Thu, 17 May 2018 10:32:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526578324; cv=none; d=google.com; s=arc-20160816; b=HVIJ+OE2Xs/1KT0/Rcpeu92Hesa3UFFLcLe5YOEJ4p9tUP7nE99E0iO2St4UNslPFD u4Uv3ufPzyQ4fCC5WSQQxS73UabJtD8LDn3BtzFsPLMbCOGpEyLLM+tojOOkKUOth0Q/ Rk14CMDZzA577GU3Df7WUKdefwLbRt43ssPBlFa4xtYkXlacmAT5hMGOPXsZ7nnpYjVa iLljOfBB5Q8k3qnhjddqgTwIUNOOH8qmp54WI0ElOQM7kLg40spjPUYeAZnmyBja3rD7 mALmFyFz2PGuEkVNVjPupGzYUY83e8JZEHz64Oae/9EZOgoI3RGpYYBf/Jcr1t/VjUbK eIWg== 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:dkim-signature:arc-authentication-results; bh=RQ5K3CU4vTpus6j96G8gXrtheW9O86pl1Rw9uIw/1Pk=; b=vizyKQlqzb4mrmuj+kCVOP9wX0Fa85z3iF+o2vQBvja4b3cyXCysB+bWgdASC9scrk b+tw9Ay2VaB/QsFlBgXl6EqRM6kL3B8k/ipio/Z2/OpQ8kG4tYjmHprnm4FrOIFMy5zC 9fIy5JLZ3pmgXr+exaLapNA2jSwPZmFB2j9+PEXIGz9uFSdPDdDLZP+4vw+dNr4w2/hY rLgAZOam8MQhtZej3PJd+GrceB1VKbmeZH/hP7ZcrLa2XX6tk6EjRVA/iNKWgsSqiqcO Fp/xY6zz66O5jt25gyOtieBMayhunhcotXfcVng2iC+M6MKWjieipmmujWsQoTM+NplP QRpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=MMgPPKb5; 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 m64-v6si5481282pfm.0.2018.05.17.10.31.49; Thu, 17 May 2018 10:32:04 -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-2017-10-26 header.b=MMgPPKb5; 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 S1752213AbeEQRbj (ORCPT + 99 others); Thu, 17 May 2018 13:31:39 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:36458 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751280AbeEQRbi (ORCPT ); Thu, 17 May 2018 13:31:38 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4HHVIhm017223; Thu, 17 May 2018 17:31:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=content-type : mime-version : subject : from : in-reply-to : date : cc : content-transfer-encoding : message-id : references : to; s=corp-2017-10-26; bh=RQ5K3CU4vTpus6j96G8gXrtheW9O86pl1Rw9uIw/1Pk=; b=MMgPPKb54HxPA2ZqxTVV3Rjoh6DxBJtTTK31kaZFQX+cvJh8a0/tffM8I2NtsUvR2fCJ sU4UDLrBVDXm1qRS8A0gKDtt1v0idNMnAoKTsJ5RgOc9A9WImIz/8U9gBBJCLTcoRPLv SJaUlaKVcXfC12QSbkk9hUTNp8ZwSZ/3eax3kB7J0u5yGY5V28xmfUvU+v9lXlSTNV9y 6LDLBS4Z/AoF+8a9PYn7UXG9/n7jEkngyh1FM/9prpxwDdp2EVfxK0ayI5YeqLE4qE8+ lMhOCPAZKTGhsmOtGwpYkMkS+mp8KyCiyCQam3BhPZ0m44feBr/5/LHK4MStbKhHJ+X7 Bw== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2hx29waaa5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 17 May 2018 17:31:17 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w4HHVHqY022927 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 17 May 2018 17:31:17 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w4HHVGL4013142; Thu, 17 May 2018 17:31:16 GMT Received: from dhcp-10-154-153-110.vpn.oracle.com (/10.154.153.110) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 17 May 2018 10:31:16 -0700 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: [RFC] mm, THP: Map read-only text segments using large THP pages From: William Kucharski In-Reply-To: <20180517152333.GA26718@bombadil.infradead.org> Date: Thu, 17 May 2018 11:31:14 -0600 Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Transfer-Encoding: quoted-printable Message-Id: <714E0B73-BE6C-408B-98A6-2A7C82E7BB11@oracle.com> References: <5BB682E1-DD52-4AA9-83E9-DEF091E0C709@oracle.com> <20180517152333.GA26718@bombadil.infradead.org> To: Matthew Wilcox X-Mailer: Apple Mail (2.3445.8.2) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8896 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=819 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805170164 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On May 17, 2018, at 9:23 AM, Matthew Wilcox = wrote: >=20 > I'm certain it is. The other thing I believe is true that we should = be > able to share page tables (my motivation is thousands of processes = each > mapping the same ridiculously-sized file). I was hoping this = prototype > would have code that would be stealable for that purpose, but you've > gone in a different direction. Which is fine for a prototype; you've > produced useful numbers. Definitely, and that's why I mentioned integration with the page cache would be crucial. This prototype allocates pages for each invocation of the executable, which would never fly on a real system. > I think the first step is to get variable sized pages in the page = cache > working. Then the map-around functionality can probably just notice = if > they're big enough to map with a PMD and make that happen. I don't = immediately > see anything from this PoC that can be used, but it at least gives us = a > good point of comparison for any future work. Yes, that's the first step to getting actual usable code designed and working; this prototype was designed just to get something working and to get a first swag at some performance numbers. I do think that adding code to map larger pages as a fault_around = variant is a good start as the code is already going to potentially map in fault_around_bytes from the file to satisfy the fault. It makes sense to extend that paradigm to be able to tune when large pages might be read in and/or mapped using large pages extant in the page cache. Filesystem support becomes more important once writing to large pages is allowed. > I think that really tells the story. We almost entirely eliminate > dTLB load misses (down to almost 0.1%) and iTLB load misses drop to 4% > of what they were. Does this test represent any kind of real world = load, > or is it designed to show the best possible improvement? It's admittedly designed to thrash the caches pretty hard and doesn't represent any type of actual workload I'm aware of. It basically calls various routines within a huge text area while scribbling to automatic arrays declared at the top of each routine. It wasn't designed as a = worst case scenario, but rather as one that would hopefully show some obvious degree of difference when large text pages were supported. Thanks for your comments. -- Bill=