Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp207889imm; Tue, 15 May 2018 00:01:24 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpFQYglK2W8YBKgA6EP/K3Lwyyd5iLznCdssVwEKHSqYpUbnUfMPihUyhLbjbbKu/1HPvCt X-Received: by 2002:a62:c2:: with SMTP id 185-v6mr13795910pfa.238.1526367684285; Tue, 15 May 2018 00:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526367684; cv=none; d=google.com; s=arc-20160816; b=yF/Du7Zu1JxVaimIAJfD/BMxE/Ym2UHQ6S3MGQbcbDkyRrxw35FkW8JsFS/uFZTktQ pmxRyB3n3vS1Isdf2zzyGjAMXWQlxOcBheRlaD9+Adrw3nCY00JZLvktSC16aT/eZV4Z r6CHvRtBY63lkPzdsGLYvk7dTdBPCpC07z00CeV/tBCRVAMZMCbRqqL3CTabx3vWAWJ8 7xUxghkYiBY7mJmssBYiKYfDDD+be8ApYWHui23c7+ieoHbyH9waEF+b32YU7e1RViZT +E2AaBNulqVNyCd4WflJAOXH3tqWsardSWiFsHNVPR0DUpr5heW1NoQCrO7Je/V9NYX8 7zWg== 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=+253FbYrvZu/MmlFHdpg1/BczlPGo26YAgw0OIiPP5w=; b=MFIG0AjSBeTC5GiReY6VIIwMqV7iKmJbwfF85cqpu9pz8tUGqDGUS1kehEVw8LAq7X o3l43HD+tdOpYmxJlbCuIsdIQSmkYJMQAv0EXD4stKXjNkeOInOIRg881In7Y/Y3gM47 2Tl7GZ15YwUEC6RnK/zGxNDQXKKSiDJ9whT+cSC4g8/xHq7kvtue2pvgf/F5J9OGkuml hxDHpNHeTVgkDm9PX/7r0b09YFZAmsLxvRfVQkvsreI3hJFaevRj2/DrMrWEy4C60K5u 9xUVOkYS6xA8bR90xRmjswhFW0DNdAsZUuio4Ps0g62y+5ZRPPlLUT3NpxBwFltHUggu ty0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=bdu+o26l; 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 e1-v6si8978048pgr.167.2018.05.15.00.01.10; Tue, 15 May 2018 00:01:24 -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=bdu+o26l; 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 S1752417AbeEOG7Z (ORCPT + 99 others); Tue, 15 May 2018 02:59:25 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:33310 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752271AbeEOG7X (ORCPT ); Tue, 15 May 2018 02:59:23 -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 w4F6tmZn105906; Tue, 15 May 2018 06:59:19 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=+253FbYrvZu/MmlFHdpg1/BczlPGo26YAgw0OIiPP5w=; b=bdu+o26loMLmuBqBJJZDs0omDwQ0pZ64LXGNBQRXKy/GChwv7eTWyKrYT9ITDToqxTpS +anPdvM33trw0gNZ+g0tfHwoEIczgcJ3ue6Z/ofYV/GmxDXNeeip9SCzRleHQvVPvMnM P7shSppNbSo4rdCE8Ogep+H6NWN8lGYDFdXlWLxdfERYGZNg67G3/JSZur+oMRUoj/+n XYu1onjSAGf/Q65peO1xvyiPpUaBK6cB2CFlE7Q7v7C562WV30Rp7p8XiGjc7siedazS Ys6yUp9oErP9PkWAWv0jfU1NBvdOKMgzFeMbhO+PhgpMTkvcac83CqzMj2iUZt+hHPRV KA== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2hx29vxxbg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 May 2018 06:59:19 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w4F6xIEq008271 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 May 2018 06:59:18 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w4F6xHrn021332; Tue, 15 May 2018 06:59:18 GMT Received: from [192.168.0.110] (/71.205.38.130) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 14 May 2018 23:59:17 -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: <010001635f3c42d3-ed92871f-4fba-47dc-9750-69a40dd07ab6-000000@email.amazonses.com> Date: Tue, 15 May 2018 00:59:16 -0600 Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <5BB682E1-DD52-4AA9-83E9-DEF091E0C709@oracle.com> <010001635f3c42d3-ed92871f-4fba-47dc-9750-69a40dd07ab6-000000@email.amazonses.com> To: Christopher Lameter X-Mailer: Apple Mail (2.3445.8.2) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8893 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=699 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805150073 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On May 14, 2018, at 9:19 AM, Christopher Lameter wrote: >=20 > Cool. This could be controlled by the faultaround logic right? If we = get > fault_around_bytes up to huge page size then it is reasonable to use a > huge page directly. It isn't presently but certainly could be; for the prototype it tries to map a large page when needed and, should that fail, it will fall through to the normal fault around code. I would think we would want a separate parameter, as I can see the = usefulness of more fine-grained control. Many users may want to try mapping a large = page if possible, but would prefer a smaller number of bytes to be read in = fault around should we need to fall back to using PAGESIZE pages. > fault_around_bytes can be set via sysfs so there is a natural way to > control this feature there I think. I agree; perhaps I could use "fault_around_thp_bytes" or something = similar. >> Since this approach will map a PMD size block of the memory map at a = time, we >> should see a slight uptick in time spent in disk I/O but a = substantial drop in >> page faults as well as a reduction in iTLB misses as address ranges = will be >> mapped with the larger page. Analysis of a test program that consists = of a very >> large text area (483,138,032 bytes in size) that thrashes D$ and I$ = shows this >> does occur and there is a slight reduction in program execution time. >=20 > I think we would also want such a feature for regular writable pages = as > soon as possible. That is my ultimate long-term goal for this project - full r/w support = of large THP pages; prototyping with read-only text pages seemed like the best = first step to get a sense of the possible benefits. -- Bill=