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.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 A54EDC4320A for ; Fri, 27 Aug 2021 15:33:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D1ECA60EE5 for ; Fri, 27 Aug 2021 15:33:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D1ECA60EE5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 2ADE26B006C; Fri, 27 Aug 2021 11:33:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2360C6B0071; Fri, 27 Aug 2021 11:33:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0FFD08D0001; Fri, 27 Aug 2021 11:33:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0213.hostedemail.com [216.40.44.213]) by kanga.kvack.org (Postfix) with ESMTP id E69E36B006C for ; Fri, 27 Aug 2021 11:33:12 -0400 (EDT) Received: from smtpin34.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 898F118024A79 for ; Fri, 27 Aug 2021 15:33:12 +0000 (UTC) X-FDA: 78521254224.34.F680CFE Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf05.hostedemail.com (Postfix) with ESMTP id D1E355026F62 for ; Fri, 27 Aug 2021 15:33:11 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 3934B67373; Fri, 27 Aug 2021 17:33:09 +0200 (CEST) Date: Fri, 27 Aug 2021 17:33:09 +0200 From: Christoph Hellwig To: Joao Martins Cc: linux-mm@kvack.org, Dan Williams , Vishal Verma , Dave Jiang , Naoya Horiguchi , Matthew Wilcox , Jason Gunthorpe , John Hubbard , Jane Chu , Muchun Song , Mike Kravetz , Andrew Morton , Jonathan Corbet , Christoph Hellwig , nvdimm@lists.linux.dev, linux-doc@vger.kernel.org Subject: Re: [PATCH v4 04/14] mm/memremap: add ZONE_DEVICE support for compound pages Message-ID: <20210827153308.GA20687@lst.de> References: <20210827145819.16471-1-joao.m.martins@oracle.com> <20210827145819.16471-5-joao.m.martins@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210827145819.16471-5-joao.m.martins@oracle.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Rspamd-Queue-Id: D1E355026F62 Authentication-Results: imf05.hostedemail.com; dkim=none; dmarc=none; spf=none (imf05.hostedemail.com: domain of hch@lst.de has no SPF policy when checking 213.95.11.211) smtp.mailfrom=hch@lst.de X-Rspamd-Server: rspam01 X-Stat-Signature: ufi5sh9m6xrhsbb3z6hbxg41b7sazhyp X-HE-Tag: 1630078391-705644 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 Fri, Aug 27, 2021 at 03:58:09PM +0100, Joao Martins wrote: > + * @geometry: structural definition of how the vmemmap metadata is populated. > + * A zero or 1 defaults to using base pages as the memmap metadata > + * representation. A bigger value will set up compound struct pages > + * representative of the requested geometry size. > * @ops: method table > * @owner: an opaque pointer identifying the entity that manages this > * instance. Used by various helpers to make sure that no > @@ -114,6 +118,7 @@ struct dev_pagemap { > struct completion done; > enum memory_type type; > unsigned int flags; > + unsigned long geometry; So why not make this a shift as I suggested somewhere deep in the last thread? Also geometry sounds a bit strange, even if I can't really offer anything better offhand. > +static inline unsigned long pgmap_geometry(struct dev_pagemap *pgmap) > +{ > + if (pgmap && pgmap->geometry) > + return pgmap->geometry; Why does this need to support a NULL pgmap? > +static void __ref memmap_init_compound(struct page *head, unsigned long head_pfn, Overly long line.