BLU Discuss list archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss] khugepaged + vmware = massive CPU load
- Subject: [Discuss] khugepaged + vmware = massive CPU load
- From: me at mattgillen.net (Matthew Gillen)
- Date: Mon, 14 Dec 2015 15:06:02 -0500
- In-reply-to: <20151213155434.b9951c82e986f06526726be0@gmail.com>
- References: <22122.13681.176279.74573@snorkack.blazemonger.com> <20151211114214.GH27495@randomstring.org> <20151213155434.b9951c82e986f06526726be0@gmail.com>
On 12/13/2015 3:54 PM, Shankar Viswanathan wrote: > On Fri, 11 Dec 2015 06:42:14 -0500 > Dan Ritter <dsr at randomstring.org> wrote: > >> Normally your system keeps track of memory in 4KB pages. They're >> analogous to filesystem blocks. Performance is improved when you >> can satisfy memory allocation requests with less overhead, so >> hugepages were created. A hugepage is a 2MB page. > > On x86_64 (aka amd64) systems, hugepage can also be 1GB. But barring large databases and playback of large media files, there isn't any benefit from using 1GB pages (it will actually harm performance for most other applications). > > The reason large page sizes are useful is that one 2MB page only uses a single TLB entry in the processor whereas the same 2MB space will need 512 entries if mapped as 4KB pages. So depending on TLB sizes in the processor, you could have lots of TLB misses if you use smaller pages, and each TLB miss takes a large number of processor cycles to do a "table walk" and fetch the translation. TLB pressure is even higher if virtualization is being used as both guest and host translations have to share the TLB. That explains why hugepages are useful, but it doesn't explain why it would be detrimental in some cases. The best I could come up with is that certain applications try to be too cute with their memory management for efficiency reasons (e.g. image processing), and only deal with 4KB chunks anyway (i.e. because they "know" how the underlying memory management works, so they over-optimized based on it). So loading that 1MB image, which should take 256 4KB pages now takes 256 2MB pages, which comes out to ~536MB. Which is probably more memory than you have spare on your system. Does that sound plausible (excusing any arithmetic errors)? Matt
- Follow-Ups:
- [Discuss] khugepaged + vmware = massive CPU load
- From: dbarrett at blazemonger.com (Daniel Barrett)
- [Discuss] khugepaged + vmware = massive CPU load
- From: richard.pieri at gmail.com (Rich Pieri)
- [Discuss] khugepaged + vmware = massive CPU load
- References:
- [Discuss] khugepaged + vmware = massive CPU load
- From: dbarrett at blazemonger.com (Daniel Barrett)
- [Discuss] khugepaged + vmware = massive CPU load
- From: dsr at randomstring.org (Dan Ritter)
- [Discuss] khugepaged + vmware = massive CPU load
- From: shankar.viswan at gmail.com (Shankar Viswanathan)
- [Discuss] khugepaged + vmware = massive CPU load
- Prev by Date: [Discuss] khugepaged + vmware = massive CPU load
- Next by Date: [Discuss] khugepaged + vmware = massive CPU load
- Previous by thread: [Discuss] khugepaged + vmware = massive CPU load
- Next by thread: [Discuss] khugepaged + vmware = massive CPU load
- Index(es):