linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: John Hubbard <jhubbard@nvidia.com>
To: Ahmed Samy <f.fallen45@gmail.com>
Cc: linux-mm@kvack.org, zhongjiang@huawei.com
Subject: Re: ioremap_page_range: remapping of physical RAM ranges
Date: Sat, 28 Jan 2017 14:13:10 -0800	[thread overview]
Message-ID: <e35e0e68-f753-3bdf-60c7-05992aed9870@nvidia.com> (raw)
In-Reply-To: <20170128215504.GA69125@devmasch>

On 01/28/2017 01:55 PM, Ahmed Samy wrote:
> On Sat, Jan 28, 2017 at 01:48:46PM -0800, John Hubbard wrote:
>> Quick question, what do you mean "a function as part of vmalloc"?
> Take a look at `vmap()', it should be like that API.  Dunno if vmap can be used
> in place, haven't tried, maybe can get `struct page` and then use vmap?  I
> don't know, what do you think?

Right, vmap is probably what you're looking for here. The way this story usually goes in my 
experience is: if you're actually dealing with real RAM, you are also dealing in struct pages. So 
you lookup the struct pages, keep track of them, (maybe also pin them with get_user_pages), and then 
map them with vmap.

Beyond the out-of-tree driver that I'm supporting (which uses vmap in that way), there are also a 
*lot* of in-tree examples that also do it.

Are you buying this? :)

thanks
john h

>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      parent reply	other threads:[~2017-01-28 22:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25 19:55 A. Samy
2017-01-25 22:27 ` John Hubbard
2017-01-25 23:15   ` Ahmed Samy
2017-01-26  8:33     ` John Hubbard
2017-01-26 18:24       ` Ahmed Samy
2017-01-28 21:11       ` Ahmed Samy
2017-01-28 21:48         ` John Hubbard
2017-01-28 21:55           ` Ahmed Samy
2017-01-28 22:12             ` Ahmed Samy
2017-01-28 22:16               ` John Hubbard
2017-01-28 22:13             ` John Hubbard [this message]

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=e35e0e68-f753-3bdf-60c7-05992aed9870@nvidia.com \
    --to=jhubbard@nvidia.com \
    --cc=f.fallen45@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=zhongjiang@huawei.com \
    /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