Re: [PATCH v6 09/11] mm/memremap_pages: convert to 'struct range'

From: boris . ostrovsky
Date: Thu Oct 08 2020 - 15:53:24 EST



On 10/6/20 2:55 AM, Dan Williams wrote:
> The 'struct resource' in 'struct dev_pagemap' is only used for holding
> resource span information. The other fields, 'name', 'flags', 'desc',
> 'parent', 'sibling', and 'child' are all unused wasted space.
>
> This is in preparation for introducing a multi-range extension of
> devm_memremap_pages().
>
> The bulk of this change is unwinding all the places internal to libnvdimm
> that used 'struct resource' unnecessarily, and replacing instances of
> 'struct dev_pagemap'.res with 'struct dev_pagemap'.range.
>
> P2PDMA had a minor usage of the resource flags field, but only to report
> failures with "%pR". That is replaced with an open coded print of the
> range.
>
> Link: https://lkml.kernel.org/r/159643103173.4062302.768998885691711532.stgit@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Link: https://lkml.kernel.org/r/20200926121402.GA7467@kadam
> Cc: Paul Mackerras <paulus@xxxxxxxxxx>
> Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
> Cc: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>
> Cc: Vishal Verma <vishal.l.verma@xxxxxxxxx>
> Cc: Vivek Goyal <vgoyal@xxxxxxxxxx>
> Cc: Dave Jiang <dave.jiang@xxxxxxxxx>
> Cc: Ben Skeggs <bskeggs@xxxxxxxxxx>
> Cc: David Airlie <airlied@xxxxxxxx>
> Cc: Daniel Vetter <daniel@xxxxxxxx>
> Cc: Ira Weiny <ira.weiny@xxxxxxxxx>
> Cc: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
> Cc: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
> Cc: Juergen Gross <jgross@xxxxxxxx>
> Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> Cc: "Jérôme Glisse" <jglisse@xxxxxxxxxx>
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx>


For Xen bits


Reviewed-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>