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.6 required=3.0 tests=BAYES_00,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 2CBDCC433ED for ; Thu, 6 May 2021 11:45:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9978D613CD for ; Thu, 6 May 2021 11:45:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9978D613CD 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 DEF046B006C; Thu, 6 May 2021 07:45:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D9EFA6B006E; Thu, 6 May 2021 07:45:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C52366B0070; Thu, 6 May 2021 07:45:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id AB49E6B006C for ; Thu, 6 May 2021 07:45:50 -0400 (EDT) Received: from smtpin40.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 590E0442C for ; Thu, 6 May 2021 11:45:50 +0000 (UTC) X-FDA: 78110626860.40.2EDBBBF Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf04.hostedemail.com (Postfix) with ESMTP id 399563E0 for ; Thu, 6 May 2021 11:45:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=mifLY5I1ASqvyJ61ckft/moipD7muFgUKiocPLAZXfE=; b=h5l6+Feu+l7JPwj29W670YStho xJ6ZccudxiObN9FbvMgKp/cESCCB3TvmFBS3p3yK/DsS4qCu/JhCepb9wFu8J3ktnpfE5uBS6lT7C IVe8OHQT20/w3WKukaB+e1Av7wdNjRvynIuflnageJIC46x+9i7GPqw8gmeFa1cL/dfj133BqJf0F sl5wdyYpZGYURuFuls8V55M03XR4vs73ANpvzpOTiDN0jd3/2QaBzOfKtWKKvRoavnW3n1z6pHSza T0RxTCE1XDopcmG+es1O+Fb+9q4GKfrtqA6t5XGah8eTFdCan40O0DvjybojOy3y4fIRZ1301Qnpu HFeUqkvA==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lecQ9-001edk-8Q; Thu, 06 May 2021 11:44:12 +0000 Date: Thu, 6 May 2021 12:43:57 +0100 From: Matthew Wilcox To: Joao Martins Cc: "Aneesh Kumar K.V" , Dan Williams , Linux MM , Ira Weiny , linux-nvdimm , Jason Gunthorpe , Jane Chu , Muchun Song , Mike Kravetz , Andrew Morton Subject: Re: [PATCH v1 04/11] mm/memremap: add ZONE_DEVICE support for compound pages Message-ID: <20210506114357.GA388843@casper.infradead.org> References: <20210325230938.30752-1-joao.m.martins@oracle.com> <20210325230938.30752-5-joao.m.martins@oracle.com> <87zgx85ltc.fsf@linux.ibm.com> <31563092-a7b8-e6e1-f5ad-a66c02243a9d@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <31563092-a7b8-e6e1-f5ad-a66c02243a9d@oracle.com> Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=h5l6+Feu; dmarc=none; spf=none (imf04.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Server: rspam03 X-Stat-Signature: 3zac1ma3nxsbkejxz14bhn9m5me93bbj X-Rspamd-Queue-Id: 399563E0 Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf04; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1620301544-825919 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 Thu, May 06, 2021 at 11:23:25AM +0100, Joao Martins wrote: > >> I think it is ok for dax/nvdimm to continue to maintain their align > >> value because it should be ok to have 4MB align if the device really > >> wanted. However, when it goes to map that alignment with > >> memremap_pages() it can pick a mode. For example, it's already the > >> case that dax->align == 1GB is mapped with DEVMAP_PTE today, so > >> they're already separate concepts that can stay separate. > > > > devdax namespace with align of 1G implies we expect to map them with 1G > > pte entries? I didn't follow when you say we map them today with > > DEVMAP_PTE entries. > > This sort of confusion is largelly why Dan is suggesting a @geometry for naming rather > than @align (which traditionally refers to page tables entry sizes in pagemap-related stuff). > > DEVMAP_{PTE,PMD,PUD} refers to the representation of metadata in base pages (DEVMAP_PTE), > compound pages of PMD order (DEVMAP_PMD) or compound pages of PUD order (DEVMAP_PUD). > > So, today: > > * namespaces with align of 1G would use *struct pages of order-0* (DEVMAP_PTE) backed with > PMD entries in the direct map. > * namespaces with align of 2M would use *struct pages of order-0* (DEVMAP_PTE) backed with > PMD entries in the direct map. > > After this series: > > * namespaces with align of 1G would use *compound struct pages of order-30* (DEVMAP_PUD) > backed with PMD entries in the direct map. order-18 > * namespaces with align of 1G would use *compound struct pages of order-21* (DEVMAP_PMD) > backed with PTE entries in the direct map. i think you mean "align of 2M", and order-9. (note that these numbers are/can be different for powerpc since it supports different TLB page sizes. please don't get locked into x86 sizes, and don't ignore the benefits *to software* of managing memory in sizes other than just those supported by the hardware).