For physical memory management, why take holes page as free pages?

Russell King - ARM Linux linux at arm.linux.org.uk
Sun Aug 26 04:40:49 EDT 2012


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.

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.



More information about the linux-arm-kernel mailing list