Adding a huge zero page
Adding a huge zero page
Posted Sep 27, 2012 9:33 UTC (Thu) by alankila (guest, #47141)Parent article: Adding a huge zero page
I observed this issue on my virtual machines test server which runs 6 virtual machines of various sizes with a total of 8 of the 16 GB of system memory. After bootup, almost all of the kvm memory was hugepage'd, but the next day only some 10 % of the memory still was. The problem was that the machines were shutdown during night for backup, and then brought back up. My guess is that the backup process filled memory with pages, some which were dirty, and this defeated the hugepages optimization.
Posted Sep 27, 2012 13:51 UTC (Thu)
by ejr (subscriber, #51652)
[Link] (7 responses)
And some of these HPC codes are old and/or expect to run on more than Linux. Conditionally changing all the user-specified and compiler-generated memory allocations is a painful task.
Posted Sep 28, 2012 9:11 UTC (Fri)
by alankila (guest, #47141)
[Link] (6 responses)
I was wondering if there shouldn't be a memory defragmenting task that goes through the running process' heap periodically and would move the 4k pages around until coalescing them to a hugepage becomes possible. I mean, if using these pages really gives you around 5 % performance benefit, it would seem reasonable to spend up to few % of CPU to do it for tasks that seem long-lived enough.
Posted Sep 28, 2012 11:13 UTC (Fri)
by nix (subscriber, #2304)
[Link] (3 responses)
AnonHugePages: 788480 kB
The latter machine is running a single virtual machine, but the former is running no VMs of any kind and has still turned a gigabyte into transpages (probably largely inside monsters like Chromium). That's not insignificant. (For that matter, I routinely see compile jobs getting hugepaged up, and a TLB saving in a pointer-mad monster like GCC really does speed it up. Sure, it's only a few percent, but that's better than nothing, right?)
Posted Sep 28, 2012 23:19 UTC (Fri)
by alankila (guest, #47141)
[Link] (2 responses)
That being said, out of 1.5 GB of other services on the server:
AnonHugePages: 71680 kB
*sigh*
Posted Sep 28, 2012 23:37 UTC (Fri)
by khc (guest, #45209)
[Link] (1 responses)
MemTotal: 16327088 kB
Of course, this box has a fairly specialized daemon that allocates 8GB of memory as 2 separate pools, so it's not surprising that auto huge pages work well (although I've never measured the performance impact of that).
Posted Sep 29, 2012 10:28 UTC (Sat)
by nix (subscriber, #2304)
[Link]
Posted Sep 28, 2012 14:09 UTC (Fri)
by ejr (subscriber, #51652)
[Link]
Posted Oct 5, 2012 16:10 UTC (Fri)
by cpasqualini (guest, #69417)
[Link]
Did you test any of these?
echo always >/sys/kernel/mm/transparent_hugepage/defrag
Adding a huge zero page
Adding a huge zero page
Adding a huge zero page
AnonHugePages: 2553856 kB
Adding a huge zero page
Adding a huge zero page
AnonHugePages: 3102720 kB
Adding a huge zero page
Adding a huge zero page
Adding a huge zero page
echo madvise >/sys/kernel/mm/transparent_hugepage/defrag
echo never >/sys/kernel/mm/transparent_hugepage/defrag