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=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 48D29C47094 for ; Mon, 7 Jun 2021 20:48:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D86FB61139 for ; Mon, 7 Jun 2021 20:48:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D86FB61139 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6B5586B006C; Mon, 7 Jun 2021 16:48:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 665736B006E; Mon, 7 Jun 2021 16:48:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 46A566B0070; Mon, 7 Jun 2021 16:48:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0152.hostedemail.com [216.40.44.152]) by kanga.kvack.org (Postfix) with ESMTP id 0C1B06B006C for ; Mon, 7 Jun 2021 16:48:41 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id A3C801AD91 for ; Mon, 7 Jun 2021 20:48:41 +0000 (UTC) X-FDA: 78228116442.25.BDB5195 Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by imf30.hostedemail.com (Postfix) with ESMTP id EE372E000571 for ; Mon, 7 Jun 2021 20:48:13 +0000 (UTC) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 157KeG88066320; Mon, 7 Jun 2021 20:47:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=wawQqFhsAZeE2su5jd0GKgukh2xjzvV+E5ZwfPLVg9M=; b=T2gZ0s+LUmGWwuswdL8WPeThd5iV9Blk3s6aThlqpG9u8aHniXE+ZqkSXIHJ3u/I3XwI iwPjdP1bcCzwcDAirree5BCg9pKNtX+772Td+DJa0PhKUkdoGazfupf3LXHzo6apArp8 A4xktAY8p+o8ans/vSyHflDaI0b6nmotCtuTgEyCA1mmeUxd768i1EdJlZQS5DfM+ayL GgxyEII7y2VBnOqhhQ66fkOw1AeuTmV8MyIoJ9QQ/Nx/Nv9uSTAq5YBIFvfLBoeX1vI3 4kJg6+skxj3EPK3p78tIEg1VSM2uJUMH/11HpIFR/+56l/ENO2iBdOjx89757nZZ59z8 +g== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 3900ps449w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 07 Jun 2021 20:47:57 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 157KeKkr006923; Mon, 7 Jun 2021 20:47:57 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam07lp2041.outbound.protection.outlook.com [104.47.56.41]) by userp3030.oracle.com with ESMTP id 38yxcu5gqt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 07 Jun 2021 20:47:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WJwMMOrjz4vK/OpM9bBAHuDTfzK5ToLQkt+RCYxAZonQzPhmg/61lMUsAdYFuvSym8Udr0fFPxO+aSJ+u9fPUEZNKenNqOxunIFtOKXc5MMeSLsGlubfRqFUNjtbO8hitF96NsE4hAUSOdTn3BY5dtKhULFsSu455t6OUBEvoWkDOtBuG6Xh1tqNbKe29nbC/V2W3HjyQlmdl/jG6WRkHPjEx3j1i2OaDLzQxhgLXsXRU+uH8AtRSx2Z89V8fDScngiB7/cntgp3oDCqC/DCzeRPz4Rhi0buQbQnnH5wi23hBmOnF2ZL4VAN2bbdCBcVI2pPQQvg/kALWK6TE1NgHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wawQqFhsAZeE2su5jd0GKgukh2xjzvV+E5ZwfPLVg9M=; b=evhu5ry8RdWGrceZP5PFZHHkqFiWZ8JUwW2ltrlJNR7AB73SeCO9N5LMqw57qhKJoY3HNc1kIHi2mLhW5Jloft0yAvFyBAeXSgbE7hQ5p1tBghcERIYFZbuu6mAmlSKMxWmtIdRfcPYJxENwXemcpPc+bY+6Ix3LfTDU2kROQRlbmXqR52owbp9mqhUiCcZ2BHHJU/joIv1sWKlZcATBTHGgd3gM1FhGuMnq8yQM1tj1BP5N03PJUCoy/ss4loYAF9NNIvajvEvNc8PsNaijeaf5DFFOf0DkO1HCQLrKmw/BRX3goGyL281nRLxeGyNipNWL4/TIKxX7CHwolzSN+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wawQqFhsAZeE2su5jd0GKgukh2xjzvV+E5ZwfPLVg9M=; b=YH+5CDeW6UylcP9CNVoc0MQ6y0ksdXntPZnON//eSp/7USX047e/iUmte93p1acA1gHD67HzrDUkEH9tOnxqOfK4JGzFzNOAhEaEEeF8odfmjYSHmwbXPiUZTvXh7P5aQckO6M00stRSE63Wq80oWSB1MJWMkdlK9pQf/8Izqzs= Received: from BLAPR10MB4835.namprd10.prod.outlook.com (2603:10b6:208:331::11) by MN2PR10MB4095.namprd10.prod.outlook.com (2603:10b6:208:11b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Mon, 7 Jun 2021 20:47:54 +0000 Received: from BLAPR10MB4835.namprd10.prod.outlook.com ([fe80::8cb1:7649:3a52:236a]) by BLAPR10MB4835.namprd10.prod.outlook.com ([fe80::8cb1:7649:3a52:236a%7]) with mapi id 15.20.4195.030; Mon, 7 Jun 2021 20:47:54 +0000 Subject: Re: [PATCH v1 04/11] mm/memremap: add ZONE_DEVICE support for compound pages To: Dan Williams Cc: Linux MM , Ira Weiny , linux-nvdimm , Matthew Wilcox , Jason Gunthorpe , Jane Chu , Muchun Song , Mike Kravetz , Andrew Morton References: <20210325230938.30752-1-joao.m.martins@oracle.com> <20210325230938.30752-5-joao.m.martins@oracle.com> <56a3e271-4ef8-ba02-639e-fd7fe7de7e36@oracle.com> <8c922a58-c901-1ad9-5d19-1182bd6dea1e@oracle.com> From: Joao Martins Message-ID: Date: Mon, 7 Jun 2021 21:47:48 +0100 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [87.196.21.203] X-ClientProxiedBy: PR3P251CA0016.EURP251.PROD.OUTLOOK.COM (2603:10a6:102:b5::8) To BLAPR10MB4835.namprd10.prod.outlook.com (2603:10b6:208:331::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.125.214] (87.196.21.203) by PR3P251CA0016.EURP251.PROD.OUTLOOK.COM (2603:10a6:102:b5::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.20 via Frontend Transport; Mon, 7 Jun 2021 20:47:52 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 88b848c8-8a5d-403c-22a1-08d929f585eb X-MS-TrafficTypeDiagnostic: MN2PR10MB4095: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T9IratVU9HK7U5P9q5ehK1qv2UyYO76ZXmRO6l6XixCdcOq9VufcNNJJ/YpMzH9qISsSEFGN7ObxAb1gxi/QMdYIZW/ekvIPaBjGjNBQtF5MmLA19Z1Tm7xOwxPd6YpaUauspsrvAZ8vicvxxk12TUudQf7gEpFtUdsDKJF8VCzClpUbpmnrrgxuW3xhX3wsq6HfpJqxu6Cm5VsCfCMRdeCEb2+1k6WNdZUmvszTHvKl44/IlnyXvvS9yldpow9wI6K3X6u5pht+WZbEg0o24XejvCz7OQV/fqyiWY5J57MDdwmn7O2pOZsiALwdIj3lU+n9c7FWcv3bZpBNEI4Oq0OiOPARBFqYj6qSTRuuoTmeosf7eb5rATEFakPexkAQUtNVm4kac1shwQeDbVNZFV7nnQHl/nMoAtdMTaVptuVBu/PhxokY7ezi/fjXOxjFUPwS48/kYgnKmayE75DU+qqW0SyEh/Eyj7QkED8s6henotMLUZ8uDfNOshj9tsBNd/U2JXFaUc0P76krImopepcz3YO0tNK9wDSMCKzy19A6+AknsiuSMu6lYAwH4qzCuuoa8sXyqPt1XYTTN24RjzFLSXczvW5F6/4fzPfnaQ+vLbcgniPSjrsUahmj80ZRfOYfBzkvga78/veUJ+LkL/grFGiGdRvdm8VuE2MYz3U= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB4835.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(396003)(346002)(376002)(366004)(39860400002)(316002)(26005)(54906003)(956004)(16576012)(38100700002)(6916009)(2616005)(66556008)(66946007)(66476007)(478600001)(2906002)(53546011)(4326008)(8676002)(8936002)(16526019)(5660300002)(6486002)(83380400001)(31686004)(186003)(6666004)(36756003)(31696002)(86362001)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?bVRZZXJ6N3JaUnUyZXR2RnFFamdYMHdOV3BRa2VYeFhTMWtMS3laam12RWJr?= =?utf-8?B?YVc0WlhZY29HN1BOTCtCU25qejFwODRlY3pWMFRpM2JEcUhONjFHRFNDWDZa?= =?utf-8?B?aEVtaDV5cDBmZUZoWTA1ZXBvN1dwRzJ0NW9QR1JYdEZnNXpvWmo3SE9wZkVv?= =?utf-8?B?eXpCcHRoZ3JrRWRtZWlYeXNuUGJyUjBVRzJ5OWtFdUdRbExDTldKaktOSUVR?= =?utf-8?B?a0s1aCtzUmxzVTRSejJLSy84dFhBc2lQakxuYUF4bHpiTERvaU1Gd1BnbGFL?= =?utf-8?B?MWJHZVpaVzI0eEkyYmYyTVBDUm84eFZRY2pwdTFETEdZMEw4aXRGejFkdVow?= =?utf-8?B?TWE3d2VrS2FoNHZ4UlRTYktZTWNpWGQrSzFGREVLYUpPcU9ORm5SdjRKaEZx?= =?utf-8?B?VjBRTWhPVVVWdHVFZEVSL1hvRGRRMDhoSFJnNzRvVDRDN0xleFZUV2lnUWIx?= =?utf-8?B?ZDhLTWgwbE9QenltMUxJbkloeTlBNk8yV29xb0tEbmtiOTNiWmR6d1h0UFdN?= =?utf-8?B?Rnh1eDZRdUVDNnBGZ0tZWVp6clpubUZFVVF1NEorYklEN2tKZFpLSlBzVXk3?= =?utf-8?B?MmRGR0dvTW5RQ24yNDJBQzNOcXk4ZlJ2MDZWRThjNTRzRDhGOXNsck1MMmRh?= =?utf-8?B?bEFtaFBKUE92Z0FEWndoc25wampQMUVSNmdSdjhpY3hCOU1WUkQ0M3VaVWVl?= =?utf-8?B?b2tNKysxTzNHVkFieGhQbXYyVXdwNDA0V2xHbHRiaDVDalp3RHJPVkgxLzBy?= =?utf-8?B?K3ZEcHQ1SnhXZEYyeTJoMzZRRUFqOHhWcXZjaVlzMHdFWStEeWRHdkZZVWRp?= =?utf-8?B?aURFZC9pTGpQU0hvY0VXTER0WkNHTHllSC9uVnU3UXVUSTEwMUR5d08wcGhG?= =?utf-8?B?NDB5SEpmRWpxMVVDRC91eHlyWU5waXFIaFBhQjQ1NnRJY2h3bUkyZU5uZ2pp?= =?utf-8?B?eStHL3F2cVA0WVU5UURxNmM3NHErU084UU1VZUNmdGlVcXY3UUsxOVlsTFlK?= =?utf-8?B?TzBzcnc4T0ltTTZVM2MyMjU1V1ZsM2NDNUxJRXBmdFd6VnowRjNUc2pXVWd1?= =?utf-8?B?TFhqMDBaS3lwTjBWbitQdVR0L0Q3MlR0bVBuM2ZnQXpPeVdHQnIydTIxSnQ0?= =?utf-8?B?b3hIK3RMYm5adjdBcmdVQWJqM3VoM1JGOHBSSmpNaS9ZVHRxMXFnZ0JxMkVZ?= =?utf-8?B?Q3dhQUJqd25BY2xGY2Y3Tk9oeGFQSlJXcnYrZitNZDZNRndtY05NdWI0b2tY?= =?utf-8?B?WHorbXNBWU1tdnNCYjNtYjlZUUgrSE9Bc3RYelFuZ0UzLzk3WmRTVW9xZ2pQ?= =?utf-8?B?UnhvdU94YVBaM3pOaHZQY2pmOFN1T0hMSEk0RWk5UjlySTNBdnpuVml3cklF?= =?utf-8?B?QmFNeTZaMDkvWlc5Sm9kTU1oNW1zYW4yWXY1Rkl3Y2FwaHlKRmZuT1QwYkgv?= =?utf-8?B?bmF1TzcxRDN5UlBxcUdhOEk4Z2tWVjVrYUVZOGRFRW9hcE1VMXB0ZXpVdGtD?= =?utf-8?B?R1VLeFQ4UEV4aHE1UnkyZWpqT3I4Zis2TlBBZFc1NE9UZThsbm1TOVMwdCtx?= =?utf-8?B?ZVVFN0duelRnY01XMnp1UXc5NkdIYlN6TTF2NVR5ckhZaHVvVjQ1eTh3WTNi?= =?utf-8?B?ODNqNFNJa2k1MklFMGZ6QkhqdThQRjVBYmNORXV1UGQveHJpS1BBOEFzdFQ5?= =?utf-8?B?L2NHaGR4Uy8ranJOSndHZmdMT1VYc0pucllNc1NvenBsM3djYVhMWDJzZXJk?= =?utf-8?Q?eSUfo22wfYf4UsZCyRwEysuQ+Q7pDXPajw7aIKi?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 88b848c8-8a5d-403c-22a1-08d929f585eb X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB4835.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2021 20:47:54.1774 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7S2ZZh2i6HLwR+zQjF5Pq7a1PqKfo9kvTze+61W79UrKb3u+J4npnUzsWX7PiYdQmemGmV7o58h1SX4uxZajPana+DNZo+3nolQlrG2l44I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB4095 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10008 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 mlxscore=0 spamscore=0 adultscore=0 mlxlogscore=999 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106070139 X-Proofpoint-GUID: FTUJWNgaMjuNoJj66blQUxMN0159K1Vh X-Proofpoint-ORIG-GUID: FTUJWNgaMjuNoJj66blQUxMN0159K1Vh X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10008 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 clxscore=1015 bulkscore=0 spamscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106070139 Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2020-01-29 header.b=T2gZ0s+L; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=YH+5CDeW; spf=none (imf30.hostedemail.com: domain of joao.m.martins@oracle.com has no SPF policy when checking 156.151.31.86) smtp.mailfrom=joao.m.martins@oracle.com; dmarc=pass (policy=none) header.from=oracle.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: EE372E000571 X-Stat-Signature: hdjzox8thc3wo7mpqs94o3rq8nresjpa X-HE-Tag: 1623098893-846012 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 6/7/21 9:17 PM, Dan Williams wrote: > On Tue, May 18, 2021 at 10:28 AM Joao Martins wrote: >> >> On 5/5/21 11:36 PM, Joao Martins wrote: >>> On 5/5/21 11:20 PM, Dan Williams wrote: >>>> On Wed, May 5, 2021 at 12:50 PM Joao Martins wrote: >>>>> On 5/5/21 7:44 PM, Dan Williams wrote: >>>>>> On Thu, Mar 25, 2021 at 4:10 PM Joao Martins wrote: >>>>>>> diff --git a/include/linux/memremap.h b/include/linux/memremap.h >>>>>>> index b46f63dcaed3..bb28d82dda5e 100644 >>>>>>> --- a/include/linux/memremap.h >>>>>>> +++ b/include/linux/memremap.h >>>>>>> @@ -114,6 +114,7 @@ struct dev_pagemap { >>>>>>> struct completion done; >>>>>>> enum memory_type type; >>>>>>> unsigned int flags; >>>>>>> + unsigned long align; >>>>>> >>>>>> I think this wants some kernel-doc above to indicate that non-zero >>>>>> means "use compound pages with tail-page dedup" and zero / PAGE_SIZE >>>>>> means "use non-compound base pages". >> >> [...] >> >>>>>> The non-zero value must be >>>>>> PAGE_SIZE, PMD_PAGE_SIZE or PUD_PAGE_SIZE. >>>>>> Hmm, maybe it should be an >>>>>> enum: >>>>>> >>>>>> enum devmap_geometry { >>>>>> DEVMAP_PTE, >>>>>> DEVMAP_PMD, >>>>>> DEVMAP_PUD, >>>>>> } >>>>>> >>>>> I suppose a converter between devmap_geometry and page_size would be needed too? And maybe >>>>> the whole dax/nvdimm align values change meanwhile (as a followup improvement)? >>>> >>>> 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. >>>> >>> Gotcha. >> >> I am reconsidering part of the above. In general, yes, the meaning of devmap @align >> represents a slightly different variation of the device @align i.e. how the metadata is >> laid out **but** regardless of what kind of page table entries we use vmemmap. >> >> By using DEVMAP_PTE/PMD/PUD we might end up 1) duplicating what nvdimm/dax already >> validates in terms of allowed device @align values (i.e. PAGE_SIZE, PMD_SIZE and PUD_SIZE) >> 2) the geometry of metadata is very much tied to the value we pick to @align at namespace >> provisioning -- not the "align" we might use at mmap() perhaps that's what you referred >> above? -- and 3) the value of geometry actually derives from dax device @align because we >> will need to create compound pages representing a page size of @align value. >> >> Using your example above: you're saying that dax->align == 1G is mapped with DEVMAP_PTEs, >> in reality the vmemmap is populated with PMDs/PUDs page tables (depending on what archs >> decide to do at vmemmap_populate()) and uses base pages as its metadata regardless of what >> device @align. In reality what we want to convey in @geometry is not page table sizes, but >> just the page size used for the vmemmap of the dax device. > > Good point, the names "PTE, PMD, PUD" imply the hardware mapping size, > not the software compound page size. > >> Additionally, limiting its >> value might not be desirable... if tomorrow Linux for some arch supports dax/nvdimm >> devices with 4M align or 64K align, the value of @geometry will have to reflect the 4M to >> create compound pages of order 10 for the said vmemmap. >> >> I am going to wait until you finish reviewing the remaining four patches of this series, >> but maybe this is a simple misnomer (s/align/geometry/) with a comment but without >> DEVMAP_{PTE,PMD,PUD} enum part? Or perhaps its own struct with a value and enum a >> setter/getter to audit its value? Thoughts? > > I do see what you mean about the confusion DEVMAP_{PTE,PMD,PUD} > introduces, but I still think the device-dax align and the > organization of the 'struct page' metadata are distinct concepts. So > I'm happy with any color of the bikeshed as long as the 2 concepts are > distinct. How about calling it "compound_page_order"? Open to other > ideas... > I actually like the name of @geometry. The only thing better would be @vmemmap_geometry solely because it makes it clear that its the vmemmap that we are talking about -- but might be unnecssarily verbose. And I still agree that is separate concept that should be named differently *at least*. But naming aside, I was trying to get at was to avoid a second geometry value validation i.e. to be validated the value and set with a value such as DEVMAP_PTE, DEVMAP_PMD and DEVMAP_PUD. That to me sounds a little redundant, when the geometry value depends on what align is going to be used from. Here my metnion of @align refers to what's used to create the dax device, not the mmap() align [which can be lower than the device one]. The dax device align is the one used to decide whether to use PTEs, PMDs or PUDs at dax fault handler. So separate concepts, but still its value dependent on one another. At least unless we want to allow geometry values different than those set by --align as Jane suggested.