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
> <paul.hartman+gen...@gmail.com> 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


Reply via email to