From: John Hubbard <jhubbard-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: "Christoph Hellwig" <hch-jcswGhMUV9g@public.gmane.org>,
"Dan Williams"
<dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
"Jérôme Glisse" <jglisse-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
"Jason Gunthorpe" <jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
"Ben Skeggs" <bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org,
linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 03/22] mm: remove hmm_devmem_add_resource
Date: Thu, 13 Jun 2019 17:54:05 -0700 [thread overview]
Message-ID: <b0136e6b-2262-ae4e-67ba-3d0b3895873b@nvidia.com> (raw)
In-Reply-To: <20190613094326.24093-4-hch-jcswGhMUV9g@public.gmane.org>
On 6/13/19 2:43 AM, Christoph Hellwig wrote:
> This function has never been used since it was first added to the kernel
> more than a year and a half ago, and if we ever grow a consumer of the
> MEMORY_DEVICE_PUBLIC infrastructure it can easily use devm_memremap_pages
> directly now that we've simplified the API for it.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> include/linux/hmm.h | 3 ---
> mm/hmm.c | 54 ---------------------------------------------
> 2 files changed, 57 deletions(-)
>
No objections here, good cleanup.
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
thanks,
--
John Hubbard
NVIDIA
> diff --git a/include/linux/hmm.h b/include/linux/hmm.h
> index 4867b9da1b6c..5761a39221a6 100644
> --- a/include/linux/hmm.h
> +++ b/include/linux/hmm.h
> @@ -688,9 +688,6 @@ struct hmm_devmem {
> struct hmm_devmem *hmm_devmem_add(const struct hmm_devmem_ops *ops,
> struct device *device,
> unsigned long size);
> -struct hmm_devmem *hmm_devmem_add_resource(const struct hmm_devmem_ops *ops,
> - struct device *device,
> - struct resource *res);
>
> /*
> * hmm_devmem_page_set_drvdata - set per-page driver data field
> diff --git a/mm/hmm.c b/mm/hmm.c
> index ff2598eb7377..0c62426d1257 100644
> --- a/mm/hmm.c
> +++ b/mm/hmm.c
> @@ -1445,58 +1445,4 @@ struct hmm_devmem *hmm_devmem_add(const struct hmm_devmem_ops *ops,
> return devmem;
> }
> EXPORT_SYMBOL_GPL(hmm_devmem_add);
> -
> -struct hmm_devmem *hmm_devmem_add_resource(const struct hmm_devmem_ops *ops,
> - struct device *device,
> - struct resource *res)
> -{
> - struct hmm_devmem *devmem;
> - void *result;
> - int ret;
> -
> - if (res->desc != IORES_DESC_DEVICE_PUBLIC_MEMORY)
> - return ERR_PTR(-EINVAL);
> -
> - dev_pagemap_get_ops();
> -
> - devmem = devm_kzalloc(device, sizeof(*devmem), GFP_KERNEL);
> - if (!devmem)
> - return ERR_PTR(-ENOMEM);
> -
> - init_completion(&devmem->completion);
> - devmem->pfn_first = -1UL;
> - devmem->pfn_last = -1UL;
> - devmem->resource = res;
> - devmem->device = device;
> - devmem->ops = ops;
> -
> - ret = percpu_ref_init(&devmem->ref, &hmm_devmem_ref_release,
> - 0, GFP_KERNEL);
> - if (ret)
> - return ERR_PTR(ret);
> -
> - ret = devm_add_action_or_reset(device, hmm_devmem_ref_exit,
> - &devmem->ref);
> - if (ret)
> - return ERR_PTR(ret);
> -
> - devmem->pfn_first = devmem->resource->start >> PAGE_SHIFT;
> - devmem->pfn_last = devmem->pfn_first +
> - (resource_size(devmem->resource) >> PAGE_SHIFT);
> - devmem->page_fault = hmm_devmem_fault;
> -
> - devmem->pagemap.type = MEMORY_DEVICE_PUBLIC;
> - devmem->pagemap.res = *devmem->resource;
> - devmem->pagemap.page_free = hmm_devmem_free;
> - devmem->pagemap.altmap_valid = false;
> - devmem->pagemap.ref = &devmem->ref;
> - devmem->pagemap.data = devmem;
> - devmem->pagemap.kill = hmm_devmem_ref_kill;
> -
> - result = devm_memremap_pages(devmem->device, &devmem->pagemap);
> - if (IS_ERR(result))
> - return result;
> - return devmem;
> -}
> -EXPORT_SYMBOL_GPL(hmm_devmem_add_resource);
> #endif /* CONFIG_DEVICE_PRIVATE || CONFIG_DEVICE_PUBLIC */
>
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
next prev parent reply other threads:[~2019-06-14 0:54 UTC|newest]
Thread overview: 103+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-13 9:43 dev_pagemap related cleanups Christoph Hellwig
[not found] ` <20190613094326.24093-1-hch-jcswGhMUV9g@public.gmane.org>
2019-06-13 9:43 ` [PATCH 01/22] mm: remove the unused ARCH_HAS_HMM_DEVICE Kconfig option Christoph Hellwig
[not found] ` <20190613094326.24093-2-hch-jcswGhMUV9g@public.gmane.org>
2019-06-13 18:30 ` Jason Gunthorpe
2019-06-13 9:43 ` [PATCH 02/22] mm: remove the struct hmm_device infrastructure Christoph Hellwig
[not found] ` <20190613094326.24093-3-hch-jcswGhMUV9g@public.gmane.org>
2019-06-13 18:46 ` Jason Gunthorpe
2019-06-13 23:06 ` John Hubbard
2019-06-13 9:43 ` [PATCH 03/22] mm: remove hmm_devmem_add_resource Christoph Hellwig
[not found] ` <20190613094326.24093-4-hch-jcswGhMUV9g@public.gmane.org>
2019-06-13 18:52 ` Jason Gunthorpe
2019-06-14 6:19 ` Christoph Hellwig
2019-06-14 0:54 ` John Hubbard [this message]
2019-06-20 19:32 ` Michal Hocko
2019-06-13 9:43 ` [PATCH 04/22] mm: don't clear ->mapping in hmm_devmem_free Christoph Hellwig
[not found] ` <20190613094326.24093-5-hch-jcswGhMUV9g@public.gmane.org>
2019-06-13 19:05 ` Jason Gunthorpe
2019-06-14 6:21 ` Christoph Hellwig
2019-06-14 1:46 ` John Hubbard
2019-06-20 19:36 ` Michal Hocko
2019-06-13 9:43 ` [PATCH 05/22] mm: export alloc_pages_vma Christoph Hellwig
2019-06-14 1:47 ` John Hubbard
2019-06-14 6:23 ` Christoph Hellwig
2019-06-20 19:17 ` Michal Hocko
2019-06-24 18:24 ` Dan Williams
[not found] ` <CAPcyv4h9+Ha4FVrvDAe-YAr1wBOjc4yi7CAzVuASv=JCxPcFaw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-06-25 7:23 ` Christoph Hellwig
2019-06-25 15:00 ` Michal Hocko
2019-06-25 18:03 ` Dan Williams
2019-06-25 19:00 ` Michal Hocko
2019-06-25 19:52 ` Dan Williams
[not found] ` <CAPcyv4hU13v7dSQpF0WTQTxQM3L3UsHMUhsFMVz7i4UGLoM89g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-06-26 5:46 ` Michal Hocko
2019-06-26 16:14 ` Dan Williams
[not found] ` <CAPcyv4jLK2F2UHqbwp4bCEiB7tL8sVsr775egKMmJvfZG+W+NQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-06-27 6:41 ` Michal Hocko
2019-06-13 9:43 ` [PATCH 06/22] mm: factor out a devm_request_free_mem_region helper Christoph Hellwig
[not found] ` <20190613094326.24093-7-hch-jcswGhMUV9g@public.gmane.org>
2019-06-13 19:16 ` Jason Gunthorpe
2019-06-14 6:24 ` Christoph Hellwig
2019-06-15 2:21 ` John Hubbard
[not found] ` <56c130b1-5ed9-7e75-41d9-c61e73874cb8-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2019-06-15 14:30 ` Christoph Hellwig
2019-06-13 9:43 ` [PATCH 07/22] memremap: move dev_pagemap callbacks into a separate structure Christoph Hellwig
[not found] ` <20190613094326.24093-8-hch-jcswGhMUV9g@public.gmane.org>
2019-06-13 19:18 ` Jason Gunthorpe
2019-06-13 20:14 ` Logan Gunthorpe
2019-06-13 9:43 ` [PATCH 08/22] memremap: pass a struct dev_pagemap to ->kill Christoph Hellwig
[not found] ` <20190613094326.24093-9-hch-jcswGhMUV9g@public.gmane.org>
2019-06-13 19:26 ` Jason Gunthorpe
2019-06-13 20:12 ` Logan Gunthorpe
2019-06-13 20:15 ` Dan Williams
2019-06-13 9:43 ` [PATCH 09/22] memremap: lift the devmap_enable manipulation into devm_memremap_pages Christoph Hellwig
[not found] ` <20190613094326.24093-10-hch-jcswGhMUV9g@public.gmane.org>
2019-06-13 19:34 ` Jason Gunthorpe
2019-06-13 20:13 ` Dan Williams
[not found] ` <20190613193427.GU22062-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2019-06-14 6:28 ` Christoph Hellwig
2019-06-13 9:43 ` [PATCH 10/22] memremap: add a migrate callback to struct dev_pagemap_ops Christoph Hellwig
[not found] ` <20190613094326.24093-11-hch-jcswGhMUV9g@public.gmane.org>
2019-06-13 23:42 ` Ralph Campbell
[not found] ` <d6916d71-c17e-74df-58f2-c28ff8044b96-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2019-06-14 6:33 ` Christoph Hellwig
2019-06-13 9:43 ` [PATCH 11/22] memremap: remove the data field in struct dev_pagemap Christoph Hellwig
[not found] ` <20190613094326.24093-12-hch-jcswGhMUV9g@public.gmane.org>
2019-06-13 19:37 ` Jason Gunthorpe
2019-06-13 9:43 ` [PATCH 12/22] memremap: provide an optional internal refcount " Christoph Hellwig
2019-06-13 9:43 ` [PATCH 13/22] device-dax: use the dev_pagemap internal refcount Christoph Hellwig
2019-06-14 0:22 ` Ira Weiny
2019-06-14 6:35 ` Christoph Hellwig
2019-06-13 9:43 ` [PATCH 14/22] nouveau: use alloc_page_vma directly Christoph Hellwig
2019-06-13 19:39 ` Jason Gunthorpe
2019-06-13 9:43 ` [PATCH 15/22] nouveau: use devm_memremap_pages directly Christoph Hellwig
2019-06-13 9:43 ` [PATCH 16/22] mm: remove hmm_vma_alloc_locked_page Christoph Hellwig
2019-06-13 9:43 ` [PATCH 17/22] mm: remove hmm_devmem_add Christoph Hellwig
[not found] ` <20190613094326.24093-18-hch-jcswGhMUV9g@public.gmane.org>
2019-06-13 19:42 ` Jason Gunthorpe
2019-06-14 6:39 ` Christoph Hellwig
2019-06-13 9:43 ` [PATCH 18/22] mm: mark DEVICE_PUBLIC as broken Christoph Hellwig
[not found] ` <20190613094326.24093-19-hch-jcswGhMUV9g@public.gmane.org>
2019-06-13 19:44 ` Jason Gunthorpe
[not found] ` <20190613194430.GY22062-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2019-06-13 19:53 ` Ralph Campbell
[not found] ` <a27251ad-a152-f84d-139d-e1a3bf01c153-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2019-06-13 19:58 ` Jason Gunthorpe
2019-06-14 0:43 ` Ira Weiny
[not found] ` <20190614004314.GD783-J5EW/p2F9lUlb2qzJQmr9q2pdiUAq4bhAL8bYrjMMd8@public.gmane.org>
2019-06-14 1:23 ` John Hubbard
[not found] ` <d2b77ea1-7b27-e37d-c248-267a57441374-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2019-06-19 19:27 ` Jason Gunthorpe
2019-06-19 19:46 ` Dan Williams
[not found] ` <20190619192719.GO9374-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2019-06-26 3:15 ` John Hubbard
[not found] ` <29f43c79-b454-0477-a799-7850e6571bd3-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2019-06-26 5:45 ` Michal Hocko
2019-06-26 6:07 ` John Hubbard
2019-06-14 6:43 ` Christoph Hellwig
2019-06-20 19:26 ` Michal Hocko
2019-06-25 7:29 ` Christoph Hellwig
[not found] ` <20190625072915.GD30350-jcswGhMUV9g@public.gmane.org>
2019-06-25 11:44 ` Jason Gunthorpe
2019-06-25 11:59 ` Christoph Hellwig
2019-06-13 9:43 ` [PATCH 19/22] mm: simplify ZONE_DEVICE page private data Christoph Hellwig
2019-06-13 9:43 ` [PATCH 20/22] mm: sort out the DEVICE_PRIVATE Kconfig mess Christoph Hellwig
[not found] ` <20190613094326.24093-21-hch-jcswGhMUV9g@public.gmane.org>
2019-06-13 19:55 ` Jason Gunthorpe
2019-06-13 9:43 ` [PATCH 21/22] mm: remove the HMM config option Christoph Hellwig
[not found] ` <20190613094326.24093-22-hch-jcswGhMUV9g@public.gmane.org>
2019-06-13 20:01 ` Jason Gunthorpe
[not found] ` <20190613200150.GB22062-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2019-06-14 6:47 ` Christoph Hellwig
2019-06-13 9:43 ` [PATCH 22/22] mm: don't select MIGRATE_VMA_HELPER from HMM_MIRROR Christoph Hellwig
[not found] ` <20190613094326.24093-23-hch-jcswGhMUV9g@public.gmane.org>
2019-06-13 20:04 ` Jason Gunthorpe
2019-06-14 1:53 ` [Nouveau] " John Hubbard
2019-06-14 6:48 ` Christoph Hellwig
2019-06-13 14:16 ` dev_pagemap related cleanups Jason Gunthorpe
[not found] ` <20190613141622.GE22062-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2019-06-14 6:12 ` Christoph Hellwig
2019-06-13 18:27 ` Dan Williams
[not found] ` <CAPcyv4jBdwYaiVwkhy6kP78OBAs+vJme1UTm47dX4Eq_5=JgSg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-06-13 20:17 ` Logan Gunthorpe
2019-06-13 20:21 ` Dan Williams
[not found] ` <CAPcyv4hx=ng3SxzAWd8s_8VtAfoiiWhiA5kodi9KPc=jGmnejg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-06-13 20:24 ` Logan Gunthorpe
[not found] ` <d0da4c86-ef52-b981-06af-b37e3e0515ee-OTvnGxWRz7hWk0Htik3J/w@public.gmane.org>
2019-06-13 20:48 ` Andrew Morton
2019-06-13 20:40 ` Jason Gunthorpe
[not found] ` <20190613204043.GD22062-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2019-06-13 21:21 ` Christoph Hellwig
[not found] ` <20190613212101.GA27174-jcswGhMUV9g@public.gmane.org>
2019-06-13 23:10 ` Jason Gunthorpe
[not found] ` <20190613231039.GE22062-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2019-06-14 6:14 ` Christoph Hellwig
2019-06-14 0:31 ` Ira Weiny
2019-06-14 6:13 ` Christoph Hellwig
2019-06-15 1:14 ` Dan Williams
[not found] ` <CAPcyv4jmk6OBpXkuwjMn0Ovtv__2LBNMyEOWx9j5LWvWnr8f_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-06-15 8:33 ` Christoph Hellwig
[not found] ` <20190615083356.GB23406-jcswGhMUV9g@public.gmane.org>
2019-06-15 18:09 ` Dan Williams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b0136e6b-2262-ae4e-67ba-3d0b3895873b@nvidia.com \
--to=jhubbard-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
--cc=bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=hch-jcswGhMUV9g@public.gmane.org \
--cc=jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=jglisse-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
--cc=linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org \
--cc=linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox