## Documentation/vm/pagemap.txt
...
* Bits 0-54 page frame number (PFN) if present
* Bits 0-4 swap type if swapped
* Bits 5-54 swap offset if swapped
* Bit 55 pte is soft-dirty (see Documentation/vm/soft-dirty.txt)
* Bit 56 page exclusively mapped (since 4.2)
* Bits 57-60 zero
* Bit 61 page is file-page or shared-anon (since 3.5)
* Bit 62 page swapped
* Bit 63 page present
...
/proc/meminfo 提供内存信息
Documentation/filesystems/proc.rst
MemTotal Total usable RAM (i.e. physical RAM minus a few reserved
bits and the kernel binary code)
MemFree Total free RAM.
MemAvailable An estimate of how much memory is available for starting new
applications, without swapping. Calculated from MemFree,
SReclaimable, the size of the file LRU lists, and the low
watermarks in each zone.
## slab allocator
Slab slab 分配器分配给内核空间使用的总内存使用量,包含 SReclaimable + SUnreclaim
SReclaimable 在内存压力大时,能够被回收的 slab 内存使用量。
如:kmalloc(__GFP_RECLAIMABLE), kmem_cache_create(SLAB_RECLAIM_ACCOUNT)
SUnreclaim 在内存压力大时,不能被回收的 slab 内存使用量。
如:默认 kmalloc(), kmem_cache_create()
CommitLimit 目前系统能够被申请的虚拟内存总大小
Committed_AS 目前系统已经申请成功的虚拟内存大小
如下,整个系统有一个 Node 0,三个 zone(DMA、DMA32、Normal),其中 Normal zone 有 1424 个 order 0 的物理页,20607 个 order 1 的物理页, 43125 个 order 2 的物理页 ... 183 个 order 10 的物理页。
/proc/pagetypeinfo,对 /proc/buddyinfo 的进一步详细解析
$ sudo cat /proc/pagetypeinfo
Page block order: 9
Pages per block: 512
Free pages count per migrate type at order 0 1 2 3 4 5 6 7 8 9 10
Node 0, zone DMA, type Unmovable 0 0 0 0 0 0 0 0 1 1 0
Node 0, zone DMA, type Movable 0 0 0 0 0 0 0 0 0 1 2
Node 0, zone DMA, type Reclaimable 0 0 0 0 0 0 0 0 0 0 0
Node 0, zone DMA, type HighAtomic 0 0 0 0 0 0 0 0 0 0 0
Node 0, zone DMA, type Isolate 0 0 0 0 0 0 0 0 0 0 0
Node 0, zone DMA32, type Unmovable 116 163 133 87 53 15 7 3 1 0 1
Node 0, zone DMA32, type Movable 3208 3182 2405 1752 1309 660 546 318 152 101 219
Node 0, zone DMA32, type Reclaimable 156 88 57 37 24 17 13 7 1 1 0
Node 0, zone DMA32, type HighAtomic 0 0 0 0 0 0 0 0 0 0 0
Node 0, zone DMA32, type Isolate 0 0 0 0 0 0 0 0 0 0 0
Node 0, zone Normal, type Unmovable 207 1355 1095 331 133 12 0 0 0 0 0
Node 0, zone Normal, type Movable 391 18682 41829 20511 5645 4836 1416 445 208 151 183
Node 0, zone Normal, type Reclaimable 1394 608 214 54 17 6 4 3 1 0 0
Node 0, zone Normal, type HighAtomic 40 27 15 7 1 0 0 0 0 0 0
Node 0, zone Normal, type Isolate 0 0 0 0 0 0 0 0 0 0 0
Number of blocks type Unmovable Movable Reclaimable HighAtomic Isolate
Node 0, zone DMA 3 5 0 0 0
Node 0, zone DMA32 14 1096 18 0 0
Node 0, zone Normal 170 6460 392 2 0
如上,Normal zone 的 Movable page 有 391 个 order 0 的物理页, 18682 个 order 1 的物理页,41829 个 order 2 的物理页 ... 183 个 order 10 的物理页。
page block order 等于 9,每一个 page block 有 512 个物理页,其中 Normal zone 的 Movable page 总共有 6460 个 page block。
/proc/zoneinfo 内存区域使用情况
每一个 zone 区域的 min/low/high 水位值,如下:
$ cat /proc/zoneinfo | grep -E "Node |min |low |high "
Node 0, zone DMA
min 15
low 18
high 21
Node 0, zone DMA32
min 2323
low 2903
high 3483
Node 0, zone Normal
min 14556
low 18195
high 21834
Node 0, zone Movable
min 0
low 0
high 0
Node 0, zone Device
min 0
low 0
high 0
/proc/slabinfo
/proc/vmallocinfo 虚拟内存分配信息
/proc/swaps swap分区使用情况
/proc/mtd 内存设备分区表信息
/proc/dma DMA(直接内存访问)通道的列表
/proc/mtrr 系统使用的Memory Type Range Registers (MTRRs)