Mailinglist Archive: opensuse (389 mails)

< Previous Next >
Re: [opensuse] Transparent Huge Pages
On Tue, 19 Mar 2019 13:49:46 +0100
Per Jessen <per@xxxxxxxxxxxx> wrote:

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.

I don't understand why madvise isn't the most useful. Surely it is
reasonable that applications that want huge pages simply ask for them?

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.

Indeed, but I still don't understand why it insists on 'never'. Surely
'madvise' fixes its problem?


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

< Previous Next >