From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id C01761381F3 for ; Fri, 3 May 2013 05:14:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EF86FE08C5; Fri, 3 May 2013 05:14:03 +0000 (UTC) Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1F3A4E089A for ; Fri, 3 May 2013 05:14:03 +0000 (UTC) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UY8Jj-0007Ib-QH for gentoo-amd64@lists.gentoo.org; Fri, 03 May 2013 07:13:59 +0200 Received: from ip68-231-22-224.ph.ph.cox.net ([68.231.22.224]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 03 May 2013 07:13:59 +0200 Received: from 1i5t5.duncan by ip68-231-22-224.ph.ph.cox.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 03 May 2013 07:13:59 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: gentoo-amd64@lists.gentoo.org From: Duncan <1i5t5.duncan@cox.net> Subject: [gentoo-amd64] Re: Advice On Enabling Transparent Hugepage Date: Fri, 3 May 2013 05:13:44 +0000 (UTC) Message-ID: References: <20130502163309.70844284755c7809c1f7cdbd@comcast.net> <20130502185142.b792fbd50bf46c13bee8ad32@comcast.net> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-amd64@lists.gentoo.org Reply-to: gentoo-amd64@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ip68-231-22-224.ph.ph.cox.net User-Agent: Pan/0.140 (Chocolate Salty Balls; GIT f3d4165 /usr/src/portage/src/egit-src/pan2) X-Archives-Salt: 48eeb24b-c886-4ce7-8051-ffa327a9e1ea X-Archives-Hash: 7009ca81ca972415306005ce6f96d741 Frank Peters posted on Thu, 02 May 2013 18:51:42 -0400 as excerpted: > On Thu, 2 May 2013 16:05:10 -0500 Paul Hartman > wrote: > >> There is a setting that lets you expose THP _only_ to those programs >> which specifically request it, rather than backwards-compatible to all >> programs if you are worried about that. >> > I don't really expect an answer, but what programs incorporate the > MADV_HUGEPAGE directive in their source code? Since THP is relatively > new for the Linux kernel, it would seem that most Linux software has not > yet included MADV_HUGEPAGE and could not benefit from THP if it is > limited to madvise only. As suggested by the manpage you quote below, it's primarily big-memory applications, including databases, virtualization, etc. Those apps stand to gain enough from it (and have enough big-money sponsored development behind them) that despite the feature being relatively new and Linux specific, their newest releases are likely to support it. > Also, if a program does include MADV_HUGEPAGE would it need to be > recompiled with a THP enabled kernel? AFAIK it wouldn't actually need rebuilt against a supporting kernel, specifically, but it may need built against a supporting linux-headers package. When built against a supporting linux-headers, the app would detect at runtime whether the running kernel has the feature available or not, and use it if so, but should still run just fine, only without that optimization, on earlier kernels or those built without the feature enabled. > These are some questions I will have to research. > > However, the madvise manpage has this to say about THP: > > "This feature is primarily aimed at applications that use large > mappings of data and access large regions of that memory at a time > (e.g., virtualization systems such as QEMU)." > > I wonder if image or sound processing applications are using > MADV_HUGEPAGE. I don't know about media apps. It may be that despite their memory usage, their access pattern doesn't benefit from huge-pages... or maybe it does... I simply don't know. Meanwhile, when you wrote the above you probably hadn't read my earlier reply as they likely crossed on the net, and I don't know if it specifically uses MADV_HUGEPAGE or not, but as I said in that reply, firefox definitely uses transparent huge-pages if they're generally available. I know this due to the zero-huge-page related bug I had with an early pre-release of the kernel that enabled that, since it was firefox triggering that bug. I temporarily turned transparent-hugepage support off due to that, but turned it back on again when the bug was fixed, before that kernel was released as a .0, and haven't had a huge-pages related problem since. But due to that now fixed bug, I definitely know at least one app that makes use of huge-pages, here. =:^) If you plan on doing a bunch of research on the subject, I strongly suggest that you look at the links I posted in the previous reply. LWN's well respected in the Linux and particularly kernel community as a relatively authoritative source, and you could certainly do worse than LWN as a source for research on the subject, but may not be able to find better. -- Duncan - List replies preferred. No HTML msgs. "Every nonfree program has a lord, a master -- and if you use the program, he is your master." Richard Stallman