Re: [PATCH] Use MAP_HUGETLB where supported (v3)

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Abhijit Menon-Sen <ams(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, andres(at)2ndquadrant(dot)com
Subject: Re: [PATCH] Use MAP_HUGETLB where supported (v3)
Date: 2013-10-24 13:06:19
Message-ID: 52691B4B.10309@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 24.10.2013 09:03, Abhijit Menon-Sen wrote:
> This is a slightly reworked version of the patch submitted by Richard
> Poole last month, which was based on Christian Kruse's earlier patch.

Thanks.

> With huge_tlb_pages=off, this is the best result I got:
>
> tps = 8680.771068 (including connections establishing)
> tps = 8721.504838 (excluding connections establishing)
>
> With huge_tlb_pages=on, this is the best result I got:
>
> tps = 9932.245203 (including connections establishing)
> tps = 9983.190304 (excluding connections establishing)
>
> (Even the worst result I got in the latter case was a smidgen faster
> than the best with huge_tlb_pages=off: 8796.344078 vs. 8721.504838.)

That's really impressive.

> One open question is what to do about rounding up the size. It should
> not be necessary, but for the fairly recent bug described at the link
> in the comment (https://bugzilla.kernel.org/show_bug.cgi?id=56881). I
> tried it without the rounding-up, and it fails on Ubuntu's 3.5.0-28
> kernel (mmap returns EINVAL).

Let's get rid of the rounding. It's clearly a kernel bug, and it
shouldn't be our business to add workarounds for any kernel bug out
there. And the worst that will happen if you're running a buggy kernel
version is that you fall back to not using huge pages (assuming
huge_tlb_pages=try).

Other comments:

* guc.c doesn't actually need sys/mman.h for anything. Getting rid of
the #include also lets you remove the configure test.

* the documentation should perhaps mention that the setting only has an
effect if POSIX shared memory is used. That's the default on Linux, but
we will try to fall back to SystemV shared memory if it fails.

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message ktm@rice.edu 2013-10-24 13:12:42 Re: CLUSTER FREEZE
Previous Message Pavan Deolasee 2013-10-24 12:40:58 Re: Patch for fail-back without fresh backup