From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E3E4C388F7 for ; Fri, 13 Nov 2020 15:20:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B18DA2223C for ; Fri, 13 Nov 2020 15:20:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="L7+0bHr9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B18DA2223C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EC63C6B005D; Fri, 13 Nov 2020 10:20:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E74A06B006C; Fri, 13 Nov 2020 10:20:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D637D6B006E; Fri, 13 Nov 2020 10:20:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0196.hostedemail.com [216.40.44.196]) by kanga.kvack.org (Postfix) with ESMTP id A93C96B005D for ; Fri, 13 Nov 2020 10:20:03 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 4F95C180AD804 for ; Fri, 13 Nov 2020 15:20:03 +0000 (UTC) X-FDA: 77479755486.12.able71_100b46227310 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id 188B0180555C0 for ; Fri, 13 Nov 2020 15:20:03 +0000 (UTC) X-HE-Tag: able71_100b46227310 X-Filterd-Recvd-Size: 4867 Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Fri, 13 Nov 2020 15:20:02 +0000 (UTC) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Fri, 13 Nov 2020 07:19:54 -0800 Received: from [10.2.162.52] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 13 Nov 2020 15:20:00 +0000 From: Zi Yan To: Matthew Wilcox CC: , Subject: Re: Are THPs the right model for the pagecache? Date: Fri, 13 Nov 2020 10:19:56 -0500 X-Mailer: MailMate (1.13.2r5673) Message-ID: <40BFC0F6-6099-4AFB-857F-7F908833F9C9@nvidia.com> In-Reply-To: <20201113044652.GD17076@casper.infradead.org> References: <20201113044652.GD17076@casper.infradead.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=_MailMate_2BF5E816-9261-4E28-A0D5-42AC62C3A970_="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1605280794; bh=r/40XSvVpf+iVNHyw0mRUaeXV9B2xH2GWBUjgziZ14Q=; h=From:To:CC:Subject:Date:X-Mailer:Message-ID:In-Reply-To: References:MIME-Version:Content-Type:X-Originating-IP: X-ClientProxiedBy; b=L7+0bHr9XKfWo+tz9GdBE0/NAAt3hLJh8sUZ9VP53IWDOPbzNuEeNTCm7XCUM6Jpq /wlM1H19luDYnT+/vdkpkZ4KJIjdHXb8mNwLlENXoHC2EcGh6H0QOCRLOKQdW2LSXq BGWmXOXbHC5pjgp++0t64Jx0vNJ3X+5O9WQ4d59uE9Ow1dB2PZzG3Bdh95oY1wIN6a 0KMfsI0TN/dGlMNdh8PG7qUxFF3crDA9AeotQF905mhDcSigL/wIC9WE7z+U6huVo1 JTcu/Nt3s+7azPHm8kcqUtFCtlPkPAwRaDGjYZQTRNBAJztxYymKILg/feMXrhwZeI L9sLgv4wRkPAA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: --=_MailMate_2BF5E816-9261-4E28-A0D5-42AC62C3A970_= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On 12 Nov 2020, at 23:46, Matthew Wilcox wrote: > When I started working on using larger pages in the page cache, I was > thinking about calling them large pages or lpages. As I worked my way > through the code, I switched to simply adopting the transparent huge > page terminology that is used by anonymous and shmem. I just changed > the definition so that a thp is a page of arbitrary order. > > But now I'm wondering if that expediency has brought me to the right > place. To enable THP, you have to select CONFIG_TRANSPARENT_HUGEPAGE, > which is only available on architectures which support using larger TLB= > entries to map PMD-sized pages. Fair enough, since that was the origin= al > definition, but the point of suppoting larger page sizes in the page > cache is to reduce software overhead. Why shouldn't Alpha or m68k use > large pages in the page cache, even if they can't use them in their TLB= s? I think the issue might come from the mixture of physical page sizes and page table entry sizes. THP in fact has two parts: the ability of managin= g a group of pages using just PageHead and the support for larger than PTE (the smallest virtual address range mapped by a page table entry) pag= e table entry mappings. The first part should be independent of the second one, but the second part relies on the first one. Maybe it is possible to pull out the code for managing physical pages from CONFIG_TRANSPARENT_= HUGEPAGE and enable it unconditionally, so any arch can take the advantage of large pages. =E2=80=94 Best Regards, Yan Zi --=_MailMate_2BF5E816-9261-4E28-A0D5-42AC62C3A970_= Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEh7yFAW3gwjwQ4C9anbJR82th+ooFAl+upB0PHHppeUBudmlk aWEuY29tAAoJEJ2yUfNrYfqKBgUQAI5HfUZYADX/CCxDx09+W71Q4CJ9+iVSJJCA tNBN1TYGpl5AsQLWAYQ7UHPnfvZZg2nM9eq/tW0cDebkuID61qOBdux3fAicFcPg J89JJB0o/FuNIbDUkN45kZ2qC4QtqI0pfIHxAuaietfaKG7zEH2m5FW/ifRJYjKA Jg+w2cPEdWA4XHPDw/3iZmun3hjEeZ0YqEWgC63p8Z9xDGWO6Kb5zpwFWZd91Ceo BDF9o+dXOji42ZkXwfv8tDXS3SlEwJHvXiX7RRok3x6EA/xIgdRusttvad6NFvTt E1nwxJplXZXJlHfBm8Et2i48xlGKhCcvcgjAi7+f0dnZj94jJEivkUnBnBZA98+l IRQFQX76UNoaOafF4xGSgjWYh7DEHmPgi++mWXYIEYfRagp9A5aWQRNKjmFB/mug W95e5KQHYXZHn+mITaIC+vHKV/+okQFm+44+yeb/7yl9FQKaYA1dNOSIgOwbmc2v fIvcn4fsQWrF2hI/lnNwTrt4T//4DdUdM/oCTzFoqKyhc27vubrUa8yFUo0R58F0 Y94/uEbHrS2/njhdraeTFiYew3xwb1cAnnajA0yUKdfIqc8Y69HPnXIll2392a8y ve3Rw21wqvsMne8BiyS/1G5RKEzI3vUEt6XQf7nVMHxY6rSv0FqG9QI5NzGD/2DM C5BY3A+c =M25A -----END PGP SIGNATURE----- --=_MailMate_2BF5E816-9261-4E28-A0D5-42AC62C3A970_=--