User: Password:
Subscribe / Log in / New account

Adding a huge zero page

Adding a huge zero page

Posted Sep 28, 2012 11:13 UTC (Fri) by nix (subscriber, #2304)
In reply to: Adding a huge zero page by alankila
Parent article: Adding a huge zero page

Working quite well here:

AnonHugePages: 788480 kB
AnonHugePages: 2553856 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?)

(Log in to post comments)

Adding a huge zero page

Posted Sep 28, 2012 23:19 UTC (Fri) by alankila (guest, #47141) [Link]

Sure. I'm not saying it never works, I just wish it worked for my use case. Anyway, explicit hugepages are not too huge a pain for now, you just have to calculate/measure how many you need and then hack some apparmor rules for kvm to allow the hugepages mount region to be accessible for writing.

That being said, out of 1.5 GB of other services on the server:

AnonHugePages: 71680 kB


Adding a huge zero page

Posted Sep 28, 2012 23:37 UTC (Fri) by khc (guest, #45209) [Link]

are we doing some kind of poll? :-)

MemTotal: 16327088 kB
AnonHugePages: 3102720 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).

Adding a huge zero page

Posted Sep 29, 2012 10:28 UTC (Sat) by nix (subscriber, #2304) [Link]

Yeah, exactly. If you run things with big heaps composed of lots of little pieces (so malloc uses arena allocation and allocates >>2Mb), you'll probably do well with transparent hugepages. If instead you have lots of little programs with small heaps, you won't see any benefit: if you have programs that make lots of medium-big allocations between 512Kb and 2Mb, you'll probably see glibc malloc falling back to mmap() of regions a bit too small to be converted into a transparent hugepage.

Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds