Re: [PATCH] Use MAP_HUGETLB where supported (v3) - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: [PATCH] Use MAP_HUGETLB where supported (v3)
Date
Msg-id 52691B4B.10309@vmware.com
Whole thread Raw
In response to [PATCH] Use MAP_HUGETLB where supported (v3)  (Abhijit Menon-Sen <ams@2ndquadrant.com>)
Responses Re: [PATCH] Use MAP_HUGETLB where supported (v3)  (Robert Haas <robertmhaas@gmail.com>)
Re: [PATCH] Use MAP_HUGETLB where supported (v3)  (Andres Freund <andres@2ndquadrant.com>)
Re: [PATCH] Use MAP_HUGETLB where supported (v3)  (Abhijit Menon-Sen <ams@2ndquadrant.com>)
List 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



pgsql-hackers by date:

Previous
From: Pavan Deolasee
Date:
Subject: Re: Patch for fail-back without fresh backup
Next
From: "ktm@rice.edu"
Date:
Subject: Re: CLUSTER FREEZE