- [ 0.000000] On node 0 totalpages: 68864
- [ 0.000000] Normal zone: 1152 pages used for memmap
- [ 0.000000] Normal zone: 0 pages reserved
- [ 0.000000] Normal zone: 37504 pages, LIFO batch:7
或者:151M + 118M = 269M
269M/4K = 68864
free_area_init_nodes --> free_area_init_node --> calculate_node_totalpages free_area_init_nodes --> free_area_init_node --> free_area_init_core
- free_area_init_core:
- /*
- * Set up the zone data structures:
- * - mark all pages reserved
- * - mark all memory queues empty
- * - clear the memory bitmaps
- */
- [ 0.000000] Normal zone: 1152 pages used for memmap
sizeof(struct page) = 36Bytes, 则(0x20000*36) >> 12 = 1152.
- [ 0.000000] Normal zone: 37504 pages, LIFO batch:7
TODO: LIFO batch是什么意思?
- [ 0.000000] Initialising map node 0 zone 0 pfns 0 -> 131072
PFN范围为0到0x20000 = 131072.
TODO: init_currently_empty_zone()函数具体做了什么?
- [ 0.000000] HighMem zone: 842 pages used for memmap
- [ 0.000000] HighMem zone: 29366 pages, LIFO batch:7
- [ 0.000000] Initialising map node 0 zone 1 pfns 131072 -> 226816
((0x37600-0x20000) * sizeof(struct page))) >> PAGE_SHIFT
= (0x17600*36)>>12
= 841.5
= 842
注意要按页对齐。
(0x37600-0x30000) - 842 = 29366
PFN 131072 = 0x20000 -> 226816 = 0x37600
- [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 66870
