Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1123613ybh; Mon, 13 Jul 2020 09:55:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAg8NDwP7RRKLUgNapYVqYzSOSKG20rXeBW0oFkLIBFTL+CjXoN47N29ibfM39fBOMeyth X-Received: by 2002:a50:fd07:: with SMTP id i7mr303937eds.221.1594659344595; Mon, 13 Jul 2020 09:55:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594659344; cv=none; d=google.com; s=arc-20160816; b=gtqWtMEPYLGE+kbvrIqCkMgBx8P0d9At6C3LxkK0R2etNavkktVTHcDZyZ/NR3mPSo 892ZWi9FnGEOI6g7+ULCgRMzwsw5M5KxBpJaCAt3stP6eU93xrEvgk/ZLusYHc/TBJ6K IEjWFRtZDzjJdTEwoVGXmKC9ibGGqavly2ZCKUA+Ir9i/fapwma9mPfUgSGP5VMG3B0R 3PsFcwkuPQG427hpMXGUKQWlUBfXxUnvxRV9H2HtqhA4wjyeLr7I5yWv37sH6RqZumYW 44Zi3+S183XzFn+ru/2pDZfGGQS68SbBxjR9camDDZDwyLxqqefa9ovJppuPs6RLg5Qy U3Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=HgOXhDZaQ0Vm8QAO9SEojO+HqYa4R2CkQWkXTg5E7NY=; b=jO/auUdUTodJ5fl4St79uIY1/cjOFYgmzpicodDkTZc3tsDm8t8yeUcF9Zn4aBEjch Cwjhy8e44Qc/aVtThdKQwmxaRq+8WlTBs8rvC8K5Sf3vAIdZYQx8X6cl6R3Apn2ADvcR SA/i1XHr2e+knsEYQvxoTbg+XWlWelgb7jiebVTILC0tNZhn+S012ZbNG21OZA3Xg6eK 3gf8rzDzRr3p7EmQYp3cLy5b4Gjw3MurKKm1fO19OMhZ+hX2vgOaBW1xwq9c5zsw0jmz dwbGTTC7jmdC+kBuqGVEetWp82R/WIxkj3SYS46JFbUXVJ8ot5WZgNTC6ihlOU+67Wnb Z2Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=gtc+M+tW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d11si8803770edz.263.2020.07.13.09.55.20; Mon, 13 Jul 2020 09:55:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=gtc+M+tW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730000AbgGMQzC (ORCPT + 99 others); Mon, 13 Jul 2020 12:55:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729659AbgGMQzC (ORCPT ); Mon, 13 Jul 2020 12:55:02 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAE47C061755 for ; Mon, 13 Jul 2020 09:55:01 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id d16so14266967edz.12 for ; Mon, 13 Jul 2020 09:55:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HgOXhDZaQ0Vm8QAO9SEojO+HqYa4R2CkQWkXTg5E7NY=; b=gtc+M+tWYcQvh1sK797pkjo7WfNXIE8olCSzxehn9iEfDXPy4UnYyp2+rSeemkOHd9 3YCD1bGiwRH6cQssBiZxingdGDUwZDouqVsreN1+gJuIGG6p5wdMSWJUxTsfZgJsaSP/ EKUruPSgSi5imDehnJ0OoKNYarRo4grmHiicSB3YKJASTXyGDOGVaFs1Xtu7/0rRGn5l W9+vrC+x0eOE026JlZDzAPRS9I7c7ZrINzB0baTS0Fv4LSjRTfPGrURIPHkOUcVtnaEy 84Ykd5bPtW/7cJhsDtttHYS1i4aFielTGd+j2sm60fnPvc5Fai51ccDG/VbXOrStWecV ncaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HgOXhDZaQ0Vm8QAO9SEojO+HqYa4R2CkQWkXTg5E7NY=; b=g87ElBcdKlrD2QkmkIS7djSq99eNssEaZgBDBtWLwOOTeWCnXrc4GpyCcPikj4mF5p +sh5MB5lSWkdMCuTXKsnN8QhGNnGxGWrfcpN8NdbDaEVdJx0J2L6EAVJCvmxvgBJgXuP 3PCXFIavuwLwSHJoc66s0Po10On2XSMTmx+v0M6lkdQfVYMUKzTMnsKKxpf38XxTJ5pn b5mBo9N+o2sxvpKHEAAJmvazWz0mkXfsAeZbTJT2p/pxaAHjsilu4tC98Kn2a83GKI1a Ml6dDoqDVMZhp5HuWmESK4U9aw1joS0JzdBoILMlgmIaX0Jx5g84zPI1GRAelYUHZOib c3mQ== X-Gm-Message-State: AOAM530CaznY36s/oevD+VBYDgcWhgGoNXaVqtennoCU+4YCrmMam1Kz 5t8RhMFGE4WmxKPZptMj8wuLljizSNF7xapb/puFAw== X-Received: by 2002:a50:d9cb:: with SMTP id x11mr299675edj.93.1594659300586; Mon, 13 Jul 2020 09:55:00 -0700 (PDT) MIME-Version: 1.0 References: <159457116473.754248.7879464730875147365.stgit@dwillia2-desk3.amr.corp.intel.com> <159457126779.754248.3575056680831729751.stgit@dwillia2-desk3.amr.corp.intel.com> <52e00a67-b686-8554-8b92-a172ba9f34b6@nvidia.com> In-Reply-To: <52e00a67-b686-8554-8b92-a172ba9f34b6@nvidia.com> From: Dan Williams Date: Mon, 13 Jul 2020 09:54:49 -0700 Message-ID: Subject: Re: [PATCH v2 19/22] mm/memremap_pages: Convert to 'struct range' To: Ralph Campbell Cc: linux-nvdimm , Paul Mackerras , Michael Ellerman , Benjamin Herrenschmidt , Vishal Verma , Dave Jiang , Ben Skeggs , David Airlie , Daniel Vetter , Ira Weiny , Jason Gunthorpe , Peter Zijlstra , Dave Hansen , Ard Biesheuvel , Linux MM , Linux Kernel Mailing List , Linux ACPI , Christoph Hellwig , Joao Martins Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 13, 2020 at 9:36 AM Ralph Campbell wrote: > > > 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 > > Cc: Michael Ellerman > > Cc: Benjamin Herrenschmidt > > Cc: Dan Williams > > Cc: Vishal Verma > > Cc: Dave Jiang > > Cc: Ben Skeggs > > Cc: David Airlie > > Cc: Daniel Vetter > > Cc: Ira Weiny > > Cc: Jason Gunthorpe > > Signed-off-by: Dan Williams > > --- > > 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. Thanks Ralph, looks like I overlooked these changes since the rebase. > 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? I'll double check my config, that one should have been flagged at build time.