Regarding remap_pfn_page

Rajat Sharma fs.rajat at gmail.com
Wed Jul 20 13:18:24 EDT 2011


On Tue, Jul 19, 2011 at 11:26 PM, mindentropy <mindentropy at gmail.com> wrote:
> Hi,
>  When I mmap pages via remap_pfn_page method would the physical frames
> assigned the linear address be contiguous? If yes what would happen if I mmap
> a huge range?
>
> Thanks.
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

>  When I mmap pages via remap_pfn_page method would the physical frames
> assigned the linear address be contiguous?

The place where you typically call remap_pfn_page is mmap handler of
your device driver. And you want to assign device memory to user
space. Note that the memory (physical pages) might be already
allocated and there is no requirement for them to have a kernel linear
address assigned to them. For example, on i386, you might allocate
pages with from high memory and remap them. These pages may not have
kernel linear address.
remap_pfn_range is just going to established a secondary virtual
address mapping for these pages into the caller process' page tables,
irrespective of whether these pages have kernel linear address or not.

> If yes what would happen if I mmap a huge range?
huge range means you already have huge physical memory to be mapped
and user space process has huge virtual memory area to accomodate
that. Note that is mapping is specific to one particular process (or
threads sharing process address space) so it is fairly possible to
establish mmap.

Rajat



More information about the Kernelnewbies mailing list