Thread (78 messages) 78 messages, 7 authors, 2021-08-25

Re: [PATCH v3 04/14] mm/memremap: add ZONE_DEVICE support for compound pages

From: Joao Martins <hidden>
Date: 2021-07-15 13:16:01
Also in: linux-mm, nvdimm

On 7/15/21 1:59 PM, Christoph Hellwig wrote:
On Wed, Jul 14, 2021 at 06:08:14PM -0700, Dan Williams wrote:
quoted
quoted
+static inline unsigned long pgmap_geometry(struct dev_pagemap *pgmap)
+{
+       if (!pgmap || !pgmap->geometry)
+               return PAGE_SIZE;
+       return pgmap->geometry;
+}
+
+static inline unsigned long pgmap_pfn_geometry(struct dev_pagemap *pgmap)
+{
+       return PHYS_PFN(pgmap_geometry(pgmap));
+}
Are both needed? Maybe just have ->geometry natively be in nr_pages
units directly, because pgmap_pfn_geometry() makes it confusing
whether it's a geometry of the pfn or the geometry of the pgmap.
Actually - do we need non-power of two sizes here?  Otherwise a shift
for the pfns would be really nice as that simplifies a lot of the
calculations.
AIUI, it's only powers-of-two: PAGE_SIZE (1 if nr of pages), PMD_SIZE (512) and PUD_SIZE (4K).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help