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=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 8CC4BC2BA19 for ; Tue, 14 Apr 2020 14:20:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4BCAA2075E for ; Tue, 14 Apr 2020 14:20:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="k+JvPfJh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4BCAA2075E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B58468E0003; Tue, 14 Apr 2020 10:20:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B2D388E0001; Tue, 14 Apr 2020 10:20:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A435E8E0003; Tue, 14 Apr 2020 10:20:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0106.hostedemail.com [216.40.44.106]) by kanga.kvack.org (Postfix) with ESMTP id 8ACCB8E0001 for ; Tue, 14 Apr 2020 10:20:25 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 471ED2C12 for ; Tue, 14 Apr 2020 14:20:25 +0000 (UTC) X-FDA: 76706670810.02.game05_3a0c0334fa2f X-HE-Tag: game05_3a0c0334fa2f X-Filterd-Recvd-Size: 4244 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Tue, 14 Apr 2020 14:20:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=EYElTyl0BVEuRZ/YZRIannaVxf8JX5ztw8CmNN6o67Y=; b=k+JvPfJhqpx47HmkCwXxr89xM+ QyEgEaoxNBUTi8nN9/LWRxUHDwtUVhOo0YNyDJ5W6ei8rlBqmf525cLWD6KlLovGZg2abMLOSLsgC U8wk4m1tAXieGZyNr7Aa3+0vMExYQ7HvVRy/YckMT6FP7pWrU6cfoQLCwlyqQ8uaDQdRqKnYkRF85 yQRnqEDKov4IQy+woIW66pkgx5WElp0Iqco0DozCF8IxXsxc8UanwYLiVg5+G2RGgAlOH8X2w+1TF 7pxsmEI4fCJ4Q8lBBtsqArFRH/jddmGFkpD7092oVyFzilyURxd1GphdGrt2GGHGW+Ljlk6PVVYT3 iSr755EQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jOMQA-0000bu-TE; Tue, 14 Apr 2020 14:20:14 +0000 Date: Tue, 14 Apr 2020 07:20:14 -0700 From: Matthew Wilcox To: Christophe Leroy Cc: Nicholas Piggin , linux-arch@vger.kernel.org, "H. Peter Anvin" , Will Deacon , x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Ingo Molnar , Borislav Petkov , Catalin Marinas , Thomas Gleixner , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 4/4] mm/vmalloc: Hugepage vmalloc mappings Message-ID: <20200414142014.GO21484@bombadil.infradead.org> References: <20200413125303.423864-1-npiggin@gmail.com> <20200413125303.423864-5-npiggin@gmail.com> <20200413134106.GN21484@bombadil.infradead.org> <36616218-1d3a-b18a-8fb8-4fc9eff22780@c-s.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <36616218-1d3a-b18a-8fb8-4fc9eff22780@c-s.fr> Content-Transfer-Encoding: quoted-printable 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: On Tue, Apr 14, 2020 at 02:28:35PM +0200, Christophe Leroy wrote: > Le 13/04/2020 =E0 15:41, Matthew Wilcox a =E9crit=A0: > > On Mon, Apr 13, 2020 at 10:53:03PM +1000, Nicholas Piggin wrote: > > > +static int vmap_pages_range_noflush(unsigned long start, unsigned = long end, > > > + pgprot_t prot, struct page **pages, > > > + unsigned int page_shift) > > > +{ > > > + if (page_shift =3D=3D PAGE_SIZE) { > >=20 > > ... I think you meant 'page_shift =3D=3D PAGE_SHIFT' > >=20 > > Overall I like this series, although it's a bit biased towards CPUs > > which have page sizes which match PMD/PUD sizes. It doesn't offer th= e > > possibility of using 64kB page sizes on ARM, for example. But it's a > > step in the right direction. >=20 > I was going to ask more or less the same question, I would have liked t= o use > 512kB hugepages on powerpc 8xx. >=20 > Even the 8M hugepages (still on the 8xx), can they be used as well, tak= ing > into account that two PGD entries have to point to the same 8M page ? >=20 > I sent out a series which tends to make the management of 512k and 8M p= ages > closer to what Linux expects, in order to use them inside kernel, for L= inear > mappings and Kasan mappings for the moment. See > https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=3D164620 > It would be nice if we could amplify it a use it for ioremaps and vmall= ocs > as well. I haven't been looking at vmalloc at all; I've been looking at the page cache. See: https://lore.kernel.org/linux-mm/20200212041845.25879-1-willy@infradead.o= rg/ Once we have large pages in the page cache, I want to sort out the API for asking the CPU to insert a TLB entry. Right now, we use set_pte_at()= , set_pmd_at() and set_pud_at(). I'm thinking something along the lines of= : vm_fault_t vmf_set_page_at(struct vm_fault *vmf, struct page *page); and the architecture can insert whatever PTEs and/or TLB entries it likes based on compound_order(page) -- if, say, it's a 1MB page, it might choose to insert 2 * 512kB entries, or just the upper or lower 512kB entr= y (depending which half of the 1MB page the address sits in).