Regarding remap_pfn_page

Rajat Sharma fs.rajat at gmail.com
Thu Jul 21 03:42:58 EDT 2011


On Wed, Jul 20, 2011 at 11:59 PM, mindentropy <mindentropy at gmail.com> wrote:
>>>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.
>
>>Assuming you have 1 single page size of physical memory. Now when you mmap a
>>huge size would all the different virtual addresses be mapping onto the same
>>physical page frame?
>
> Apologize for multiple messages.
>
> On my x86_64 machine with 3GB of RAM I cannot mmap a of len=16*1024*1024. So I
> am assuming it did not find contiguous pages or has run out of contiguous
> pages(Again assuming that the amount of pages reserved for this is small
> either the memory hole or the high memory).
>
>

So your question is rather more confined : Whether you can allocate
physically cotigous memory of 16MB, right? Mapping is not an issue
here. proper error handling will anyways tell you whether you
succeeded or not. I think with kmalloc, you may not get memory larger
than 4MB.
You can definitely maintain allocation in smaller chunks and maintain
a pool on top of them (simple array). with some linear one-to-one
scheme between virtual address and your pool, you can assign them to
vma.

-Rajat



More information about the Kernelnewbies mailing list