On 08/14/2013 06:33 AM, Yinghai Lu wrote:
......
init_mem_mapping()
Now we top and down, so initial page tables in in BRK, other page tables
is near the top!
Hi yinghai, tj,
About the page table, the current logic is to use BRK to map the highest
range
of memory. And then, use the mapped range to map the rest ranges, downwards.
In alloc_low_pages():
57 ret = memblock_find_in_range(min_pfn_mapped <<
PAGE_SHIFT,
58 max_pfn_mapped << PAGE_SHIFT,
59 PAGE_SIZE * num , PAGE_SIZE);
......
63 pfn = ret >> PAGE_SHIFT;
......
78 return __va(pfn << PAGE_SHIFT);
So if we want to allocate page tables near the kernelimage, we have to do
the following:
1. Use BRK to map a range near kernel image, let's call it range X.
2. Calculate how much memory needed to map all the memory, let's say Y
Bytes.
Use range X to map at least Y Bytes memory near kernel image.
3. Use the mapped memory to map all the rest memory.
Does this sound OK to you guys ?
Thanks.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>