Mailinglist Archive: opensuse (389 mails)

< Previous Next >
Re: [opensuse] Transparent Huge Pages

I run a busy php service. Running perf on it showed it's primary CPU activity was memory compaction. Google suggested that this was THP, and, indeed turning off THP dropped CPU load down noticeably. From what research I could understand, I believe this is essentially the same problem as redis. Lot's of small transactions triggering a lot of excess memory compaction in order to allocate a larger page.

On 0319, Per Jessen wrote:
Dave Howorth wrote:

On Tue, 19 Mar 2019 13:49:46 +0100
Per Jessen <per@xxxxxxxxxxxx> wrote:

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?

Just to be on the safe side - madvise() is for apps to tell the kernel
about their intended use of memory, i.e. size and access pattern. I
guess it means using 2M pages if the app consumes memory in large

Wrt redis, I guess it uses lots of small chunks of memory, which
could suffer from always using chunks that are much bigger than

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

Erroring on the side of caution ? if they understand madvise() as
little as us, saying 'never' is safe.

Josef Fortier
Systems Administrator
Phone: 612-330-1479

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

< Previous Next >
Follow Ups