On 7/12/20 9:27 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.

P2PDMA had a minor usage of the flags field, but only to report failures
with "%pR". That is replaced with an open coded print of the range.

Cc: Paul Mackerras <pau...@ozlabs.org>
Cc: Michael Ellerman <m...@ellerman.id.au>
Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org>
Cc: Dan Williams <dan.j.willi...@intel.com>
Cc: Vishal Verma <vishal.l.ve...@intel.com>
Cc: Dave Jiang <dave.ji...@intel.com>
Cc: Ben Skeggs <bske...@redhat.com>
Cc: David Airlie <airl...@linux.ie>
Cc: Daniel Vetter <dan...@ffwll.ch>
Cc: Ira Weiny <ira.we...@intel.com>
Cc: Jason Gunthorpe <j...@mellanox.com>
Signed-off-by: Dan Williams <dan.j.willi...@intel.com>
---
  arch/powerpc/kvm/book3s_hv_uvmem.c     |   13 +++--
  drivers/dax/bus.c                      |   10 ++--
  drivers/dax/bus.h                      |    2 -
  drivers/dax/dax-private.h              |    5 --
  drivers/dax/device.c                   |    3 -
  drivers/dax/hmem/hmem.c                |    5 ++
  drivers/dax/pmem/core.c                |   12 ++---
  drivers/gpu/drm/nouveau/nouveau_dmem.c |    3 +
  drivers/nvdimm/badrange.c              |   26 +++++------
  drivers/nvdimm/claim.c                 |   13 +++--
  drivers/nvdimm/nd.h                    |    3 +
  drivers/nvdimm/pfn_devs.c              |   12 ++---
  drivers/nvdimm/pmem.c                  |   26 ++++++-----
  drivers/nvdimm/region.c                |   21 +++++----
  drivers/pci/p2pdma.c                   |   11 ++---
  include/linux/memremap.h               |    5 +-
  include/linux/range.h                  |    6 ++
  mm/memremap.c                          |   77 ++++++++++++++++----------------
  tools/testing/nvdimm/test/iomap.c      |    2 -
  19 files changed, 135 insertions(+), 120 deletions(-)

I think you are missing a call to memremap_pages() in lib/test_hmm.c
and a call to release_mem_region() that need to be converted too.
Try setting CONFIG_TEST_HMM=m.

Also, what about the call to release_mem_region() in
drivers/gpu/drm/nouveau/nouveau_dmem.c? Doesn't that need a small change too?

Reply via email to