Re: Superpages?

From: Alan Cox <alan.l.cox_at_gmail.com>
Date: Mon, 18 Aug 2008 18:57:30 -0500
I'm sorry for not responding to your earlier message, but I was swamped with
work.

On Sun, Aug 17, 2008 at 7:40 AM, Ivan Voras <ivoras_at_freebsd.org> wrote:

> hi,
>
> I'm interested in trying superpages and I have some questions about it:
>
> - In what state is the current work? (enabled by default?)


Superpages are not enabled by default but support for them is a standard
part of the amd64 and i386 kernel on HEAD.  You can enable superpages on
either of those architectures by simply setting  the tunable
vm.pmap.pg_ps_enabled to a non-zero value at boot time.

In general, I would strongly encourage people to enable superpages if their
system uses Pentium 4, Core 2, or AMD tri/quad-core ("k10") processors.  On
these processors, superpages may or may not help your application's
performance, but they are very unlikely to ever hurt it. Single/dual-core
Opterons and Athlon 64s ("k8") work fine.  In fact, I did most of the
development on Opterons.  However, it's "50-50" whether or not a given
application will speed up or slow down on a k8-family processor because of
their small TLB for large page mappings.

It's worth mentioning that there are other secondary benefits to
superpages.  They reduce the memory consumed by pv entries ("reverse
physical to virtual mappings"), and they reduce the cost of forking an
address space.

I may enable superpages by default on amd64 in the near future.  I haven't
decided.


> - Are superpages available for i386 (I remember that in the early days
> they were AMD64-only)


There are a few improvements in the amd64 implementation that haven't made
their way to i386 yet, but the i386 implementation is solid.


>
> - What kinds of loads would they help the most? I'm specifically interested
> in web servers so lots of IPC between apache, php and database.
>


The performance benefits are a function of two parameters: The first being
the underlying machine, mainly, the structure of its TLB.  The second has to
do with the application's memory access patterns.  Roughly speaking,
applications that use a large amount of memory will benefit, but there are
other factors.  (See my paper at http://
ft.ornl.gov/pubs-archive/2008-ISPASS-*TLB*.pdf for more details.)

Regards,
Alan
Received on Mon Aug 18 2008 - 22:26:46 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:33 UTC