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=-8.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 19F5BC433ED for ; Wed, 19 May 2021 11:29:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9115E611C2 for ; Wed, 19 May 2021 11:29:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9115E611C2 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 154A36B0036; Wed, 19 May 2021 07:29:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 12C576B006C; Wed, 19 May 2021 07:29:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E73148D0002; Wed, 19 May 2021 07:29:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0198.hostedemail.com [216.40.44.198]) by kanga.kvack.org (Postfix) with ESMTP id B2CED6B0036 for ; Wed, 19 May 2021 07:29:46 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 4E494988D for ; Wed, 19 May 2021 11:29:46 +0000 (UTC) X-FDA: 78157760772.13.3F93B6A Received: from aserp2130.oracle.com (aserp2130.oracle.com [141.146.126.79]) by imf20.hostedemail.com (Postfix) with ESMTP id 2E90E7BD for ; Wed, 19 May 2021 11:29:45 +0000 (UTC) Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 14JBEJNw151419; Wed, 19 May 2021 11:29:34 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=/nyOFdQT8WhaphGfSvFgRjfjzPkuK22nw9piIetqOgU=; b=CbOyXzMP2uFTh5dueN6TcUSDUaxUZ0lyvjWI+5MIW8uVV/cX0GZI80AM5WMawCoJjsi7 FSUZtu1fo/40KxuK9VAf95IcKtT0kb+9PjWSyr8iNCbo34sCGJubFUfpdoclBzkGHvdj YLCIMV3D36c8ebbwfGXFA3IqAPW8JmfoQRaX/5VfmHFmWKzajXwZWHxXQcWWHzUr+Zyi xuyDqPReQqhzYEl/A9xvhK5Z9JWAlQuvjCK/KAUX8Kknp0n6LO5unlY4kwDT/YNiWzSS OkncTkle2hp6y6Kp7F67p8cUXoTVFgjElp1AAGN5ABdM5ZKrlwhxm8AT7YXRQHMs0IXv rg== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2130.oracle.com with ESMTP id 38j3tbhavp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 May 2021 11:29:33 +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 14JBGMmm010170; Wed, 19 May 2021 11:29:33 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2174.outbound.protection.outlook.com [104.47.58.174]) by userp3030.oracle.com with ESMTP id 38megkddc3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 May 2021 11:29:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YWXNE0CcUry9Kfrkj/eetTqOShOIg68MZXnbPmLdhejQJNk3V79uE+fQksAAR3y/q9gp32KGY4VIzue9vmjNqkvIb7w3uoC+JGCMqNVRbd+MmeDpJKzsXE0P7GrLrr+DnZE5Iq0TmDUVswiX3Z/CoD3K6mrA5RduR5pzo1SXM+3K+TUSLpe+c3LfX2tzk3Yi1rhEaboze+/9Mvnw6qF3uo7mqFB2No3H3ZJmYuA3Z6CzmNOZuhSda9ABIAEtGIG0hWxE8l2/yq1szizrKLB5OPPYULdgu0Eh9/wJSm9/kibiaf3ntnyLyUC57PPlhCbCw51QMAFvLMmOVXJ7nzJn5Q== 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=/nyOFdQT8WhaphGfSvFgRjfjzPkuK22nw9piIetqOgU=; b=ggC/+3saTXcQSabPetEWpyU0dLk0ch4gefeXZUzP8CR/KTeAyh/YVHFI0aTwkPtWnP1ZpDBE5e7yIeIjiN+yLH3uwI56eYtthaE7LyHGWG7IAT0S16x5ezI9f3wCYFPhTqec2wQRDP8cHJIOTGPA0YmAN5CkwqtvFW6hNuDPGBm08AAAbAsSzdYDQ8wovtYtyg5uh6YVvTT4NcKkG07E8mEHf5wkGdNXIdo62q4OI7RqncbKoWthly+1KisTRjlQqqCSRcP80EAYcR2U49BqLgaekfXFQMnJZvZ6zluiyh1tk4cUvlYxHQV16JaVHM1Qd9Qwhn5h+Y3SJb6p1+MbGQ== 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=/nyOFdQT8WhaphGfSvFgRjfjzPkuK22nw9piIetqOgU=; b=PPHt1/lwBz07hOG7Ngk/Dt66O82nogLn7b+k0gyIRCZBC1pLp+ESK51D5MxI4EEQfr0vYMqjUZNZ2udHYSgUxMhU/hbdwk6AAqWYwmvbUdcLBRtm3ZAGaXvokkwubt3MbwPZSn48Wu8ck8OwtdUMS9XEc8zQYp5WQr/qAA59PXU= Received: from BLAPR10MB4835.namprd10.prod.outlook.com (2603:10b6:208:331::11) by BL0PR10MB2770.namprd10.prod.outlook.com (2603:10b6:208:7e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Wed, 19 May 2021 11:29:30 +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.4129.032; Wed, 19 May 2021 11:29:30 +0000 Subject: Re: [PATCH v1 04/11] mm/memremap: add ZONE_DEVICE support for compound pages To: Jane Chu , Dan Williams Cc: Linux MM , Ira Weiny , linux-nvdimm , Matthew Wilcox , Jason Gunthorpe , 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: Wed, 19 May 2021 12:29:25 +0100 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US X-Originating-IP: [94.61.1.144] X-ClientProxiedBy: LO4P123CA0262.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:194::15) To BLAPR10MB4835.namprd10.prod.outlook.com (2603:10b6:208:331::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.67] (94.61.1.144) by LO4P123CA0262.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:194::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25 via Frontend Transport; Wed, 19 May 2021 11:29:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f0509ec4-6b8f-4367-58f4-08d91ab95e68 X-MS-TrafficTypeDiagnostic: BL0PR10MB2770: 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: oCbXbM3j4Wc2uUe2JaAxOGwvNlxyyMbrf7oVm17RObI8pdzKToUEoMWwBk2eIEahCg2+bzOaHgEoIo/XgA1a+XoGpcOe2Eo7TaN0TIRh2aDjuULg4/XtIclDphF60S+lbRtfJdNfAzzKU9fKZf6OScf4oIgjzVaivmVAmYjy+ShpQEMc33dF9eVqKmMl/+JEaPx78sZY5qjXDngNBdKgN1G9Lm+vIJqaZ9ziRJAyFV4xE+Dja7k4p+3zLInkF94tH2xwClJWPCWlxNwNGzApfOPzqkjHvq8qKKlNd34BfmcJc9fn3I9x9wDqdlYNP6wDMe+wPhJwWZFo+Ym1hvEWRl8b/vvcjfkuDm+GbpQaU1kj3OFv83z0+VAq6MPWLqqffDzpI73KRodha/jhYfUQRjpZr9T+Cd9i0FBCdVnv/RpvAqT+Q/7tB4siUJhLJOFQE2dmVs9o1Vm3hjbAq5vJnzQW+NUMoyEgDjBErty+u+X+MM3y6wsBjPaqzJz2F7h3wK0Qby2Jjw9gRuPwHy9fPjrZtcLxV9EbXAkmzpLa1Wofde3UKkkwrJj+vuyTwo+lcUc5h8x+cfylicA2tcSRW0oTConchZlUa2d8zgzb1ZLSMx0LXcc3QnnutTP3m0mZSzDgDrvqUHPbh+WcEpeiNg== 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:(366004)(396003)(346002)(136003)(376002)(39860400002)(5660300002)(6486002)(110136005)(16526019)(186003)(16576012)(316002)(8936002)(54906003)(8676002)(83380400001)(31686004)(36756003)(38100700002)(4326008)(2906002)(31696002)(86362001)(53546011)(26005)(478600001)(6666004)(66476007)(66946007)(956004)(2616005)(66556008)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?RXI1SnFkS3I5YkhHeVFzQXdtT0c2M0pSY0xiS0pDNVRYOXNzU0JjN215L2E2?= =?utf-8?B?S0duWm1EMTIySDNGVXl2RE9wY05PNDN4ajE5anpHaTI5WDBNcmsyc3FTekl1?= =?utf-8?B?dDFXUVRJaXpTeGE3c2poeC8rNGtoRjJxM0paM3RRdzRteG8rRiszQjdzcGta?= =?utf-8?B?STlsNVRjTVRHSitmSnNyN3N3UGlVMGFuT29NNzJ4OWdnRXQxL3RjYXJTeS9U?= =?utf-8?B?RTZ4WTFacHJZTnRKNGlXSVh4NURPeDdZWldPNWVyMXp1MFA5MFhDVlNnSHVB?= =?utf-8?B?ZVlGeEJ0OTdna0dISlc5VFhKdVdaWU4wRmF0YVVBYTZ6ZEV1Y3hDNFlxc011?= =?utf-8?B?VlFIMjZsSzY4bVJ5RXprODJIRlR4Y1JaRzBxYXNxcGFXQjBWelF5bDBTL1pU?= =?utf-8?B?bFV4d2x1Rys4b1JXaGZHbjk2bVkzMEpLdnRJb201VXVGTW9BSS9SeS9FaFVi?= =?utf-8?B?bGJsQnh6S0VMeGhjUy9McXNOUEFUdVpsWm51bG9XQ0F3cFpHditPRCtyTjRw?= =?utf-8?B?R3g2bisxYWQ1ODA2WXlLcGMvZ0dZU1p6WEFEb2hnOC9sbW4rRmpJb1NrWW9l?= =?utf-8?B?Q1UxdnJTUnhQbGVsLzE3aWU2LzdJYUd3eWIxb1lkTndtb0F2OGhQaCtRRXFV?= =?utf-8?B?T2Vad2FMc2ZzZmVEbmFOWnUxekxkdjJoc0ZGOU1BNzdKQ2hJUTNiZXRBQWVo?= =?utf-8?B?di96Rks2enFGampieVRWU1RWcDRvNmpmVnJlMmwxYld5NS9STkc1OXBTbHZm?= =?utf-8?B?UXkvc0QwVDJVQkNyL25OdW9XVE9TOWU3czBEL3RhK1VSNTh0U2tTUFlBWUJU?= =?utf-8?B?VitONnBKclNYT1RpcXNqM1ZVUzI1OW9wbFRiVW82VkNFcFNycXhuQzBaZkJ6?= =?utf-8?B?ckVJcGtsRVpVdll2VUNJMmNQaGRTZ0gvRlEyZTNZUjRzVXRWeVdEVStsOVhF?= =?utf-8?B?WDNpNjVTVkM5YldHa05vR3g3dk9Wa2hxNGROelRyQmhiWXNYYkE5YXVvVXds?= =?utf-8?B?OENvMlp4VHFpY29RampvMnhFWEp1ZllIbk41MGlEVURibUNYWDVVVUZsZFJO?= =?utf-8?B?UjhDY1Q4TXpqS1prV1Vocm1qYzNmUGl0QWREVDU3eWVIQXp5Ylp2ckZLOWI5?= =?utf-8?B?blltYXZqL0ZsQUNOQ3BMaGdYMklNbXdodDBrbHVKV0VJbUZrZEtEek96NjBT?= =?utf-8?B?di9SSXVEQUNZc3VjRk5tWWJlVFpRU1RpeWtmbVlFQXFnMCtKMlJndG8wYU91?= =?utf-8?B?M21jZ2k1eFRmblA3dmNjS093b1JTWjRGTjlnMmt0NVFxOFRCTFo3ZVUyNlM2?= =?utf-8?B?VWRpMEludDUxVU5nOEhiZ09JbFN4U2l1Y1hYa0ZKOFpHUi9zVE8rRkZ4UmtI?= =?utf-8?B?WmxHZVRHT0NwM205ZU4yN1VWbTZnZEw3MldJamFYcG9LbC8wSDFTWWhvanlh?= =?utf-8?B?U25PdE0vWmpPRkNQWi9EMjBZUzFYY2g4TEJrQmdGejY1R29iSkNFd3FUSjFL?= =?utf-8?B?aEpuSjlBV2VsT2tsc1kyOEtRblh5RXgzMGZ0NXJuTGFwaS9FUDhuSWFMZ3ZT?= =?utf-8?B?V1I4b2wvUnRTYm5McmlVUVMrR1Y2clQxT1NNVkRGenYyMWdTcVV3QkZLYlRE?= =?utf-8?B?R082eHFBWlNyOVorRXZhLzNlMVZqWnprcG5jbmViT3lvN1lESlFHakE5Y3BG?= =?utf-8?B?QVJ0N3hEeUJCTFpEOTBRb0VyaU9Oc2ZHQkUwTGt0ODZyOUJYQ0kwZnZac3NZ?= =?utf-8?Q?W7dpCA685cZLHy/RC2X0LSNar7WzinJWDzvag8V?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f0509ec4-6b8f-4367-58f4-08d91ab95e68 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB4835.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2021 11:29:30.6019 (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: YbRZHQFW8LrdPfcg0PHIfiRrdHkDnA91egH//LuM1xR07iWbHmJRDNGNnVDCe+qdHMyMit2Ndo4B3V/J5givBPQFz99ZL74UgX9sudjGmqE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR10MB2770 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9988 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 adultscore=0 malwarescore=0 bulkscore=0 mlxscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105190075 X-Proofpoint-ORIG-GUID: Z4Kazl6n80LHyEGY-Vt1bb5fGsLVQycm X-Proofpoint-GUID: Z4Kazl6n80LHyEGY-Vt1bb5fGsLVQycm X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9988 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 malwarescore=0 spamscore=0 priorityscore=1501 suspectscore=0 mlxlogscore=999 mlxscore=0 impostorscore=0 adultscore=0 clxscore=1015 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105190075 Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2020-01-29 header.b=CbOyXzMP; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="PPHt1/lw"; dmarc=pass (policy=none) header.from=oracle.com; spf=none (imf20.hostedemail.com: domain of joao.m.martins@oracle.com has no SPF policy when checking 141.146.126.79) smtp.mailfrom=joao.m.martins@oracle.com X-Stat-Signature: y499dcg863xxtymon4zh5jjuf4fukw4p X-Rspamd-Queue-Id: 2E90E7BD X-Rspamd-Server: rspam02 X-HE-Tag: 1621423785-985870 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 5/18/21 8:56 PM, Jane Chu wrote: > On 5/18/2021 10:27 AM, Joao Martins wrote: >=20 >> 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_SI= ZE >>>>>> 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 b= e needed too? And maybe >>>>> the whole dax/nvdimm align values change meanwhile (as a followup i= mprovement)? >>>> 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 =3D=3D 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. ho= w 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, PM= D_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 devic= e @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 =3D=3D 1G is m= apped with DEVMAP_PTEs, >> in reality the vmemmap is populated with PMDs/PUDs page tables (depend= ing on what archs >> decide to do at vmemmap_populate()) and uses base pages as its metadat= a regardless of what >> device @align. In reality what we want to convey in @geometry is not p= age table sizes, but >> just the page size used for the vmemmap of the dax device. Additionall= y, limiting its >> value might not be desirable... if tomorrow Linux for some arch suppor= ts dax/nvdimm >> devices with 4M align or 64K align, the value of @geometry will have t= o 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 patch= es 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? >=20 > Good points there. >=20 > My understanding is that=C2=A0 dax->align=C2=A0 conveys granularity of = size while=20 > carving out a namespace it's a geometry attribute loosely akin to secto= r size of a spindle=20 > disk.=C2=A0 I tend to think that device pagesize=C2=A0 has almost no re= lation to "align" in that, it's=20 > possible to have 1G "align" and 4K pagesize, or verse versa.=C2=A0 That= is, with the advent of compound page=20 > support, it is possible to totally separate the two concepts. >=20 > How about adding a new option to "ndctl create-namespace" that describe= s=20 > device creator's desired pagesize, and another parameter to describe wh= ether the pagesize shall=20 > be fixed or allowed to be split up, such that, if the intention is to n= ever split up 2M pagesize, then it=20 > would be possible to save a lot metadata space on the device? Maybe that can be selected by the driver too, but it's an interesting poi= nt you raise should we settle with the geometry (e.g. like a geometry sysfs entry IIUC= your suggestion?). device-dax for example would use geometry =3D=3D align and = therefore save space (like what I propose in patch 10). But fsdax would retain the default tha= t is geometry =3D PAGE_SIZE and align =3D PMD_SIZE should it want to split pages. Interestingly, devmap poisoning always occur at @align level regardless o= f @geometry. What I am not sure is what value (vs added complexity) it brings to allow= geometry *value* to be selecteable by user given that so far we seem to only ever initiali= ze metadata as either sets of base pages [*] or sets of compound pages (of a size). And = the difference between both can possibly be summarized to split-ability like you say. [*] that optionally can are morphed into compound pages by driver