如果有人可以根据以下输出帮我做一些计算,我将不胜感激:
init_memory_mapping: 0000000000000000-0000000037bfe000
0000000000 - 0000200000 page 4k
0000200000 - 0037a00000 page 2M
0037a00000 - 0037bfe000 page 4k
kernel direct mapping tables up to 0x37bfdfff @ [mem 0x009fa000-0x009fffff]
RAMDISK: 7d11f000 - 7fff0000
Allocated new RAMDISK: 34d2d000 - 37bfd661
Move RAMDISK from 000000007d11f000 - 000000007ffef660 to 34d2d000 - 37bfd660
ACPI: RSDP 000f9aa0 00014 (v00 ACPIAM)
ACPI: RSDT bf6a0000 0003C (v01 062711 RSDT0931 20110627 MSFT 00000097)
ACPI: FACP bf6a0200 00084 (v01 062711 FACP0931 20110627 MSFT 00000097)
ACPI: DSDT bf6a0440 05835 (v01 1AAAA 1AAAA000 00000000 INTL 20051117)
ACPI: FACS bf6ae000 00040
ACPI: APIC bf6a0390 0006C (v01 062711 APIC0931 20110627 MSFT 00000097)
ACPI: MCFG bf6a0400 0003C (v01 062711 OEMMCFG 20110627 MSFT 00000097)
ACPI: OEMB bf6ae040 00072 (v01 062711 OEMB0931 20110627 MSFT 00000097)
ACPI: HPET bf6aa440 00038 (v01 062711 OEMHPET 20110627 MSFT 00000097)
ACPI: GSCI bf6ae0c0 02024 (v01 062711 GMCHSCI 20110627 MSFT 00000097)
ACPI: Local APIC address 0xfee00000
4228MB HIGHMEM available.
891MB LOWMEM available.
mapped low ram: 0 - 37bfe000
low ram: 0 - 37bfe000
Zone PFN ranges:
DMA 0x00000010 -> 0x00001000
Normal 0x00001000 -> 0x00037bfe
HighMem 0x00037bfe -> 0x00140000
Movable zone start PFN for each node
Early memory PFN ranges
0: 0x00000010 -> 0x0000009b
0: 0x00000100 -> 0x00040200
0: 0x00100000 -> 0x00140000
On node 0 totalpages: 524683
free_area_init_node: node 0, pgdat c04f7380, node_mem_map f252c200
DMA zone: 32 pages used for memmap
DMA zone: 0 pages reserved
DMA zone: 3947 pages, LIFO batch:0
Normal zone: 1752 pages used for memmap
Normal zone: 222502 pages, LIFO batch:31
HighMem zone: 8457 pages used for memmap
HighMem zone: 287993 pages, LIFO batch:31
好的,基本上我已经尝试计算DMA,ZONE_NORMAL和ZONE_HIGHMEM区域的大小。但是,通过将范围与页数进行比较,我无法做到正确。
例如,基于0x00000010的范围 - > DMA的0x00001000我会说它由4080页组成,它给我们~16MiB。对于x86区域,它看起来是正确的。但是当我看到这一部分时:
DMA zone: 32 pages used for memmap
DMA zone: 0 pages reserved
DMA zone: 3947 pages, LIFO batch:0
共有3979页,剩下的101在哪里?
对于ZONE_NORMAL,它可以很好地转换为0x00001000 - >减去保留页数后,0x00037bfe到222502。
对于ZONE_HIGHMEM,它甚至不接近287993页。 0x00037bfe - > 0x00140000给了我1082370 - 即使从中减去memmap的页面,它的值也会更大。但是,它匹配:4228MB HIGHMEM可用。
如果你想到它,范围看起来应该是这样,至少将它按照这里描述的内容进行比较:
https://www.kernel.org/doc/gorman/html/understand/understand005.html
总结'只是看起来。
我显然在这里遗漏了一些东西,所以如果有人可以看一下并提出建议,那就太棒了。 :)如果您需要更多细节,请告诉我。
谢谢!