LWN.net Logo

Adding a huge zero page

Adding a huge zero page

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

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

*sigh*


(Log in to post comments)

Adding a huge zero page

Posted Sep 28, 2012 23:37 UTC (Fri) by khc (subscriber, #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 © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds