Welcome! Log In Create A New Profile

Advanced

Increasing AnonHugePages?

Posted by Michael Benedict 
I have a system with 64GB RAM running 3.2.14. I want to run an application on it that will leverage huge pages without modifying the code, if it can be avoided. It seemed AnonHugePages would be a great answer, and it mostly is. Unfortunately, no matter what I do only 3GB of my RAM is allocated to AnonHugePages. I have 48GB for overcommit hugepages. I was able to allocate 48GB of reserved huge pages (echo 24576 > /proc/sys/vm/nr_hugepages), verify they were allocated, and then free them. That convinced me this is not a problem with fragmentation... the memory is there in 2MB chunks. Is there a way to change how many huge pages are reserved in the AnonHugePage pool?

snapshots while my memory-intensive app is running, showing it uses all the available anonymous huge pages:
# grep AnonHuge /proc/20457/smaps|sort|uniq -c
1103 AnonHugePages: 0 kB
3 AnonHugePages: 10240 kB
1 AnonHugePages: 20480 kB
24 AnonHugePages: 2048 kB
1 AnonHugePages: 28672 kB
4 AnonHugePages: 40960 kB
10 AnonHugePages: 4096 kB
408 AnonHugePages: 6144 kB
12 AnonHugePages: 63488 kB
12 AnonHugePages: 8192 kB

# cat /proc/meminfo
MemTotal: 66084120 kB
MemFree: 274820 kB
Buffers: 7984 kB
Cached: 37833476 kB
SwapCached: 0 kB
Active: 5002496 kB
Inactive: 37138932 kB
Active(anon): 3991064 kB
Inactive(anon): 313332 kB
Active(file): 1011432 kB
Inactive(file): 36825600 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 16777212 kB
SwapFree: 16777212 kB
Dirty: 461572 kB
Writeback: 0 kB
AnonPages: 4299560 kB
Mapped: 20984972 kB
Shmem: 4560 kB
Slab: 1447312 kB
SReclaimable: 1273928 kB
SUnreclaim: 173384 kB
KernelStack: 6576 kB
PageTables: 59648 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 49819272 kB
Committed_AS: 7870024 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 635212 kB
VmallocChunk: 34325520360 kB
HardwareCorrupted: 0 kB
AnonHugePages: 3700736 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 9108 kB
DirectMap2M: 2060288 kB
DirectMap1G: 65011712 kB


/sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never
/sys/kernel/mm/transparent_hugepage/defrag
[always] madvise never
/sys/kernel/mm/transparent_hugepage/khugepaged/defrag
1
/sys/kernel/mm/transparent_hugepage/khugepaged/max_ptes_none
511
/sys/kernel/mm/transparent_hugepage/khugepaged/pages_to_scan
4096
/sys/kernel/mm/transparent_hugepage/khugepaged/pages_collapsed
21316
/sys/kernel/mm/transparent_hugepage/khugepaged/full_scans
2563
/sys/kernel/mm/transparent_hugepage/khugepaged/scan_sleep_millisecs
10000
/sys/kernel/mm/transparent_hugepage/khugepaged/alloc_sleep_millisecs
60000

Thanks!
Michael
Author:

Your Email:


Subject:


Spam prevention:
Please, solve the mathematical question and enter the answer in the input field below. This is for blocking bots that try to post this form automatically.
Question: how much is 11 plus 5?
Message: