Mailinglist Archive: opensuse (389 mails)

< Previous Next >
Re: [opensuse] Transparent Huge Pages
  • From: Per Jessen <per@xxxxxxxxxxxx>
  • Date: Tue, 19 Mar 2019 13:49:46 +0100
  • Message-id: <q6qoha$m1n$1@saturn.local.net>
Dave Howorth wrote:

On Mon, 18 Mar 2019 22:51:48 +0100
David Haller <dnh@xxxxxxxxxxxx> wrote:

/usr/src/linux/Documentation/vm/transhuge.txt

Thanks, somebody on the redis list just pointed me to that page on the
kernel website. Unfortunately it doesn't even tell me what the default
is for the 'enabled' control, let alone explain why or what the effect
of changing it would be in terms I can understand.

Very simplified - it's all about performance. With a large amount of
memory, the TLB (which caches address lookups from virtual to physical)
grows too big, which will slow down the access.

By using 2M pages instead of 4K pages, the number of TLB entries is
significantly reduced, thereby causing a TLB miss to be much faster.
Also, when each TLB entry covers a much large page, we will have fewer
TLB misses.

I would say using THP is probably most beneficial to a virtual host, but
I don't know what the effect (if any/measurable) might be for a real
server or a desktop.

The settings are fairly obvious -

always - always use huge pages
never - never use huge pages
madvise - use huge pages when madvise() requests it.

I am also not certain of when the latter will be useful. Wrt redis, I
guess it uses lots of small chunks of memory, which could suffer from
always using chunks that are much bigger than needed.



--
Per Jessen, Zürich (6.8°C)
http://www.dns24.ch/ - free dynamic DNS, made in Switzerland.


--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups