6

我没有在系统中设置任何大页面。为什么直接映射有一个奇怪的值 DirectMap4k:251600 kB DirectMap2M:5941248 kB DirectMap1G:130023424 kB

查看命令行,没有指定大页面。还有运行时的大页面,目录中只有 2M 的大页面条目,没有指定任何内容。

# cat /proc/cmdline 
BOOT_IMAGE=/vmlinuz-3.11.0-26-generic root=UUID=7e5b93c9-ace5-4a9d-8623-c6718a2d720a ro console=ttyS0,9600 console=tty0 rootdelay=90 nomodes

_hugepages 3:~# cat /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr 
0                                               ^C
_hugepages 3:~# cat /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr 
0

# free -k
             total       used       free     shared    buffers     cached
Mem:     131911116   43668088   88243028          0     202272    2004796
-/+ buffers/cache:   41461020   90450096
Swap:      3999740          0    3999740



# cat /proc/meminfo 
MemTotal:       131911116 kB
MemFree:        87704076 kB
Buffers:          202272 kB
Cached:          2004444 kB
SwapCached:            0 kB
Active:         38864132 kB
Inactive:        1784416 kB
Active(anon):   38441104 kB
Inactive(anon):     7924 kB
Active(file):     423028 kB
Inactive(file):  1776492 kB
Unevictable:        8384 kB
Mlocked:            8384 kB
SwapTotal:       3999740 kB
SwapFree:        3999740 kB
Dirty:               120 kB
Writeback:             0 kB
AnonPages:      38450956 kB
Mapped:            29576 kB
Shmem:               760 kB
Slab:            1441772 kB
SReclaimable:     184536 kB
SUnreclaim:      1257236 kB
KernelStack:       11632 kB
PageTables:       146568 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    69955296 kB
Committed_AS:   81453204 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      721460 kB
VmallocChunk:   34291709228 kB
HardwareCorrupted:     0 kB
AnonHugePages:   5980160 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:      251600 kB
DirectMap2M:     5941248 kB
**DirectMap1G:    130023424 kB**
4

1 回答 1

2

它计算映射为 4KB 页面、2MB/4MB 页面和 1GB 页面(如果支持和使用)的页面数。如果/proc/sys/vm/nr_hugepages设置为(不带参数0启动内核) ,则没有任何效果:hugepages

cat /proc/sys/vm/nr_hugepages
0

看看Linux 的“/proc/meminfo”文件中的 HardwareCorrupted、DirectMap4k、DirectMap2M 字段是什么意思?更多细节。

于 2018-10-16T12:36:28.487 回答