vmalloc size
卜弋天
buyit at live.cn
Tue Jun 26 00:01:55 EDT 2012
> Suppose your machine has 1 GB of RAM with a physical addresses of
> 0x40000000 thru 0x7FFFFFFF
>
> Let's suppose that PHYS_OFFSET = 0xC0000000
> Let's suppose that VMALLOC_START is set to 0xE0000000 and VMALLOC_END
> is at 0xEFFFFFFF (256 Mb)
>
is this PAGE_OFFSET or PHYS_OFFSET?
> So what we have is that memory from 0xC0000000 thru 0xDFFFFFFF (512
> Mb) is kernel direct mapped memory and maps to physical addresses
> 0x40000000 thru 0x5FFFFFFF
>
> Physical memory from 0x60000000 thru 0x7FFFFFFF (512Mb) is considered
> high-mem. For the most part this is only usable by user-space. From
> kernel space, you need to use the kmap/kunmap functions to even access
> the memory.
>
i don't think high-memory is only used by user-space.
vmalloc() funciton will try to allocate physical memory from high_memory first, if there is no high_memory, then allocate from normal region.
> However, if you call vmalloc and lets suppose that vmalloc just
> happens to return 0xE0000000. The physical address of the first page
> might be 0xD2345000.
>
suppose vmalloc() return 0xE0000000, which is the VMALLOC_START, then the physical memory address
should be 0x60000000 thru 0x7FFFFFFF in your example.
> What's important is that the physical pages which back up the vmalloc
> area all come from the kernel direct mapped area. They won't ever be
> backed by pages from high-memory. So the physical addresses will all
> be in the range 0x40000000 thru 0x5FFFFFFF.
>
what do you mean "back up", maybe i have some misunderstanding.
in my opnion, vmalloc area should map to physical address 0x60000000 thru 0x7FFFFFFF first,
if this resion is exhausted, then normal area will be allocated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120626/9c7222cf/attachment.html
More information about the Kernelnewbies
mailing list