From: Jason Gunthorpe <jgg@mellanox.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Dan Williams <dan.j.williams@intel.com>,
Bharata B Rao <bharata@linux.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: Re: [PATCH 5/5] memremap: provide a not device managed memremap_pages
Date: Sun, 11 Aug 2019 22:56:07 +0000 [thread overview]
Message-ID: <20190811225601.GC15116@mellanox.com> (raw)
In-Reply-To: <20190811081247.22111-6-hch@lst.de>
On Sun, Aug 11, 2019 at 10:12:47AM +0200, Christoph Hellwig wrote:
> The kvmppc ultravisor code wants a device private memory pool that is
> system wide and not attached to a device. Instead of faking up one
> provide a low-level memremap_pages for it. Note that this function is
> not exported, and doesn't have a cleanup routine associated with it to
> discourage use from more driver like users.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> include/linux/memremap.h | 1 +
> mm/memremap.c | 74 ++++++++++++++++++++++++----------------
> 2 files changed, 45 insertions(+), 30 deletions(-)
>
> diff --git a/include/linux/memremap.h b/include/linux/memremap.h
> index 8f0013e18e14..eac23e88a94a 100644
> +++ b/include/linux/memremap.h
> @@ -123,6 +123,7 @@ static inline struct vmem_altmap *pgmap_altmap(struct dev_pagemap *pgmap)
> }
>
> #ifdef CONFIG_ZONE_DEVICE
> +void *memremap_pages(struct dev_pagemap *pgmap, int nid);
> void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap);
> void devm_memunmap_pages(struct device *dev, struct dev_pagemap *pgmap);
> struct dev_pagemap *get_dev_pagemap(unsigned long pfn,
> diff --git a/mm/memremap.c b/mm/memremap.c
> index 09a087ca30ff..7b7575330db4 100644
> +++ b/mm/memremap.c
> @@ -137,27 +137,12 @@ static void dev_pagemap_percpu_release(struct percpu_ref *ref)
> complete(&pgmap->done);
> }
>
> -/**
> - * devm_memremap_pages - remap and provide memmap backing for the given resource
> - * @dev: hosting device for @res
> - * @pgmap: pointer to a struct dev_pagemap
> - *
> - * Notes:
> - * 1/ At a minimum the res and type members of @pgmap must be initialized
> - * by the caller before passing it to this function
> - *
> - * 2/ The altmap field may optionally be initialized, in which case
> - * PGMAP_ALTMAP_VALID must be set in pgmap->flags.
> - *
> - * 3/ The ref field may optionally be provided, in which pgmap->ref must be
> - * 'live' on entry and will be killed and reaped at
> - * devm_memremap_pages_release() time, or if this routine fails.
> - *
> - * 4/ res is expected to be a host memory range that could feasibly be
> - * treated as a "System RAM" range, i.e. not a device mmio range, but
> - * this is not enforced.
> +/*
> + * This version is not intended for system resources only, and there is no
Was 'is not' what was intended here? I'm having a hard time reading
this.
Jason
next prev parent reply other threads:[~2019-08-11 22:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-11 8:12 add a not device managed memremap_pages Christoph Hellwig
2019-08-11 8:12 ` [PATCH 1/5] resource: pass a name argument to devm_request_free_mem_region Christoph Hellwig
2019-08-11 8:12 ` [PATCH 2/5] resource: add a not device managed request_free_mem_region variant Christoph Hellwig
2019-08-11 22:52 ` Jason Gunthorpe
2019-08-12 7:40 ` Christoph Hellwig
2019-08-11 8:12 ` [PATCH 3/5] memremap: remove the dev field in struct dev_pagemap Christoph Hellwig
2019-08-11 8:12 ` [PATCH 4/5] memremap: don't use a separate devm action for devmap_managed_enable_get Christoph Hellwig
2019-08-11 8:12 ` [PATCH 5/5] memremap: provide a not device managed memremap_pages Christoph Hellwig
2019-08-11 22:56 ` Jason Gunthorpe [this message]
2019-08-12 7:40 ` Christoph Hellwig
2019-08-12 14:50 ` Bharata B Rao
2019-08-12 15:00 ` Christoph Hellwig
2019-08-13 4:56 ` Bharata B Rao
2019-08-14 6:11 ` Christoph Hellwig
2019-08-14 8:58 ` Bharata B Rao
2019-08-14 11:25 ` Christoph Hellwig
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=20190811225601.GC15116@mellanox.com \
--to=jgg@mellanox.com \
--cc=akpm@linux-foundation.org \
--cc=bharata@linux.ibm.com \
--cc=dan.j.williams@intel.com \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-nvdimm@lists.01.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;
as well as URLs for NNTP newsgroup(s).