For physical memory management, why take holes page as free pages?
Li Haifeng
omycle at gmail.com
Sun Aug 26 05:06:35 EDT 2012
Thanks for your patience.
2012/8/26 Russell King - ARM Linux <linux at arm.linux.org.uk>:
> On Sun, Aug 26, 2012 at 12:29:13PM +0800, Li Haifeng wrote:
>> I understand, but also confused. More seriously, mem_map array is a
>> obsoleted comment in the code, right? It really means node_bootmem_map
>> of a memory node, and it 's a bitmap, which a bit indicated a
>> page,right?
>
> No. You're confusing two things - the bootmem bitmap array, and the
> mem_map array, which is an array of "struct page"s. One struct page
> exists per page, where each struct page is normally around 32 bytes.
> So one 4K page of struct pages is 128 entries in the map, which covers
> 512kB of memory.
Yes. The key is mem_map. And I understand now.
Thanks very much again.
>
> Take the case where you have a hole of 128MB between your memory banks.
> That's 256 pages of unused page structures, or a total of 1MB of memory
> consumed by unused page structures.
Regards,
Haifeng Li
More information about the linux-arm-kernel
mailing list