我没有在系统中设置任何大页面。为什么直接映射具有一个值得的值 DirectMap4k:251600 kB DirectMap2M:5941248 kB DirectMap1G:130023424 kB
查看cmdline,没有指定大页面。还有运行时hugepages,目录中只有2M的hugepage条目,没有指定。
# 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**
答案 0 :(得分:0)
如果支持和使用,它将计算映射为4KB页面,2MB / 4MB页面和1GB页面的页面数。如果将/proc/sys/vm/nr_hugepages
设置为0
(不使用hugepages
参数引导内核),则没有任何作用:
cat /proc/sys/vm/nr_hugepages
0
有关更多详细信息,请参见what does mean by HardwareCorrupted, DirectMap4k, DirectMap2M fields in “/proc/meminfo” file of Linux?。