patch: add MAP_HUGETLB to mmap() where supported (WIP)

Started by Richard Pooleover 12 years ago82 messageshackers
Jump to latest
#1Richard Poole
richard@2ndQuadrant.com

The attached patch adds the MAP_HUGETLB flag to mmap() for shared memory
on systems that support it. It's based on Christian Kruse's patch from
last year, incorporating suggestions from Andres Freund.

On a system with 4GB shared_buffers, doing pgbench runs long enough for
each backend to touch most of the buffers, this patch saves nearly 8MB of
memory per backend and improves performances by just over 2% on average.

It is still WIP as there are a couple of points that Andres has pointed
out to me that haven't been addressed yet; also, the documentation is
incomplete.

Richard

--
Richard Poole http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachments:

hugepages-v1.patchtext/x-diff; charset=us-asciiDownload+290-2
#2Peter Eisentraut
peter_e@gmx.net
In reply to: Richard Poole (#1)
Re: patch: add MAP_HUGETLB to mmap() where supported (WIP)

On Sat, 2013-09-14 at 00:41 +0100, Richard Poole wrote:

The attached patch adds the MAP_HUGETLB flag to mmap() for shared
memory on systems that support it.

Please fix the tabs in the SGML files.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Richard Poole (#1)
Re: patch: add MAP_HUGETLB to mmap() where supported (WIP)

On 14.09.2013 02:41, Richard Poole wrote:

The attached patch adds the MAP_HUGETLB flag to mmap() for shared memory
on systems that support it. It's based on Christian Kruse's patch from
last year, incorporating suggestions from Andres Freund.

I don't understand the logic in figuring out the pagesize, and the
smallest supported hugepage size. First of all, even without the patch,
why do we round up the size passed to mmap() to the _SC_PAGE_SIZE?
Surely the kernel will round up the request all by itself. The mmap()
man page doesn't say anything about length having to be a multiple of
pages size.

And with the patch, why do you bother detecting the minimum supported
hugepage size? Surely the kernel will choose the appropriate hugepage
size just fine on its own, no?

It is still WIP as there are a couple of points that Andres has pointed
out to me that haven't been addressed yet;

Which points are those?

I wonder if it would be better to allow setting huge_tlb_pages=try even
on platforms that don't have hugepages. It would simply mean the same as
'off' on such platforms.

- Heikki

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Andres Freund
andres@anarazel.de
In reply to: Heikki Linnakangas (#3)
Re: patch: add MAP_HUGETLB to mmap() where supported (WIP)

On 2013-09-16 11:15:28 +0300, Heikki Linnakangas wrote:

On 14.09.2013 02:41, Richard Poole wrote:

The attached patch adds the MAP_HUGETLB flag to mmap() for shared memory
on systems that support it. It's based on Christian Kruse's patch from
last year, incorporating suggestions from Andres Freund.

I don't understand the logic in figuring out the pagesize, and the smallest
supported hugepage size. First of all, even without the patch, why do we
round up the size passed to mmap() to the _SC_PAGE_SIZE? Surely the kernel
will round up the request all by itself. The mmap() man page doesn't say
anything about length having to be a multiple of pages size.

I think it does:
EINVAL We don't like addr, length, or offset (e.g., they are too
large, or not aligned on a page boundary).
and
A file is mapped in multiples of the page size. For a file that is not a multiple
of the page size, the remaining memory is zeroed when mapped, and writes to that
region are not written out to the file. The effect of changing the size of the
underlying file of a mapping on the pages that correspond to added or removed
regions of the file is unspecified.

And no, according to my past experience, the kernel does *not* do any
such rounding up. It will just fail.

And with the patch, why do you bother detecting the minimum supported
hugepage size? Surely the kernel will choose the appropriate hugepage size
just fine on its own, no?

It will fail if it's not a multiple.

It is still WIP as there are a couple of points that Andres has pointed
out to me that haven't been addressed yet;

Which points are those?

I don't know which point Richard already has fixed, so I'll let him
comment on that.

I wonder if it would be better to allow setting huge_tlb_pages=try even on
platforms that don't have hugepages. It would simply mean the same as 'off'
on such platforms.

I wouldn't argue against that.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#5Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Andres Freund (#4)
Re: patch: add MAP_HUGETLB to mmap() where supported (WIP)

On 16.09.2013 13:15, Andres Freund wrote:

On 2013-09-16 11:15:28 +0300, Heikki Linnakangas wrote:

On 14.09.2013 02:41, Richard Poole wrote:

The attached patch adds the MAP_HUGETLB flag to mmap() for shared memory
on systems that support it. It's based on Christian Kruse's patch from
last year, incorporating suggestions from Andres Freund.

I don't understand the logic in figuring out the pagesize, and the smallest
supported hugepage size. First of all, even without the patch, why do we
round up the size passed to mmap() to the _SC_PAGE_SIZE? Surely the kernel
will round up the request all by itself. The mmap() man page doesn't say
anything about length having to be a multiple of pages size.

I think it does:
EINVAL We don't like addr, length, or offset (e.g., they are too
large, or not aligned on a page boundary).

That doesn't mean that they *all* have to be aligned on a page boundary.
It's understandable that 'addr' and 'offset' have to be, but it doesn't
make much sense for 'length'.

and
A file is mapped in multiples of the page size. For a file that is not a multiple
of the page size, the remaining memory is zeroed when mapped, and writes to that
region are not written out to the file. The effect of changing the size of the
underlying file of a mapping on the pages that correspond to added or removed
regions of the file is unspecified.

And no, according to my past experience, the kernel does *not* do any
such rounding up. It will just fail.

I wrote a little test program to play with different values (attached).
I tried this on my laptop with a 3.2 kernel (uname -r: 3.10-2-amd6), and
on a VM with a fresh Centos 6.4 install with 2.6.32 kernel
(2.6.32-358.18.1.el6.x86_64), and they both work the same:

$ ./mmaptest 100 # mmap 100 bytes

in a different terminal:
$ cat /proc/meminfo | grep HugePages_Rsvd
HugePages_Rsvd: 1

So even a tiny allocation, much smaller than any page size, succeeds,
and it reserves a huge page. I tried the same with larger values; the
kernel always uses huge pages, and rounds up the allocation to a
multiple of the huge page size.

So, let's just get rid of the /sys scanning code.

Robert, do you remember why you put the "pagesize =
sysconf(_SC_PAGE_SIZE);" call in the new mmap() shared memory allocator?

- Heikki

Attachments:

mmaptest.ctext/x-csrc; name=mmaptest.cDownload
#6Andres Freund
andres@anarazel.de
In reply to: Heikki Linnakangas (#5)
Re: patch: add MAP_HUGETLB to mmap() where supported (WIP)

On 2013-09-16 16:13:57 +0300, Heikki Linnakangas wrote:

On 16.09.2013 13:15, Andres Freund wrote:

On 2013-09-16 11:15:28 +0300, Heikki Linnakangas wrote:

On 14.09.2013 02:41, Richard Poole wrote:

The attached patch adds the MAP_HUGETLB flag to mmap() for shared memory
on systems that support it. It's based on Christian Kruse's patch from
last year, incorporating suggestions from Andres Freund.

I don't understand the logic in figuring out the pagesize, and the smallest
supported hugepage size. First of all, even without the patch, why do we
round up the size passed to mmap() to the _SC_PAGE_SIZE? Surely the kernel
will round up the request all by itself. The mmap() man page doesn't say
anything about length having to be a multiple of pages size.

I think it does:
EINVAL We don't like addr, length, or offset (e.g., they are too
large, or not aligned on a page boundary).

That doesn't mean that they *all* have to be aligned on a page boundary.
It's understandable that 'addr' and 'offset' have to be, but it doesn't make
much sense for 'length'.

and
A file is mapped in multiples of the page size. For a file that is not a multiple
of the page size, the remaining memory is zeroed when mapped, and writes to that
region are not written out to the file. The effect of changing the size of the
underlying file of a mapping on the pages that correspond to added or removed
regions of the file is unspecified.

And no, according to my past experience, the kernel does *not* do any
such rounding up. It will just fail.

I wrote a little test program to play with different values (attached). I
tried this on my laptop with a 3.2 kernel (uname -r: 3.10-2-amd6), and on a
VM with a fresh Centos 6.4 install with 2.6.32 kernel
(2.6.32-358.18.1.el6.x86_64), and they both work the same:

$ ./mmaptest 100 # mmap 100 bytes

in a different terminal:
$ cat /proc/meminfo | grep HugePages_Rsvd
HugePages_Rsvd: 1

So even a tiny allocation, much smaller than any page size, succeeds, and it
reserves a huge page. I tried the same with larger values; the kernel always
uses huge pages, and rounds up the allocation to a multiple of the huge page
size.

When developing the prototype I am pretty sure I had to add the rounding
up - but I am not sure why now, because after chatting with Heikki about
it, I've looked around and the initial MAP_HUGETLB support in the kernel
(commit 4e52780d41a741fb4861ae1df2413dd816ec11b1) has support for
rounding up.

So, let's just get rid of the /sys scanning code.

Alternatively we could round up NBuffers to actually use the
additionally allocated space. Not sure if that's worth the amount of
code, but wasting several megabytes - or even gigabytes - of memory
isn't nice either.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#7Andres Freund
andres@anarazel.de
In reply to: Andres Freund (#6)
Re: patch: add MAP_HUGETLB to mmap() where supported (WIP)

On 2013-09-16 15:18:50 +0200, Andres Freund wrote:

So even a tiny allocation, much smaller than any page size, succeeds, and it
reserves a huge page. I tried the same with larger values; the kernel always
uses huge pages, and rounds up the allocation to a multiple of the huge page
size.

When developing the prototype I am pretty sure I had to add the rounding
up - but I am not sure why now, because after chatting with Heikki about
it, I've looked around and the initial MAP_HUGETLB support in the kernel
(commit 4e52780d41a741fb4861ae1df2413dd816ec11b1) has support for
rounding up.

Ok, the reason for that seems to have been the following bug
https://bugzilla.kernel.org/show_bug.cgi?id=56881

Greetings,

Andres Freund

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#8Robert Haas
robertmhaas@gmail.com
In reply to: Heikki Linnakangas (#5)
Re: patch: add MAP_HUGETLB to mmap() where supported (WIP)

On Mon, Sep 16, 2013 at 9:13 AM, Heikki Linnakangas
<hlinnakangas@vmware.com> wrote:

Robert, do you remember why you put the "pagesize = sysconf(_SC_PAGE_SIZE);"
call in the new mmap() shared memory allocator?

Hmm, no. Unfortunately, I don't. We could try ripping it out and see
if the buildfarm breaks. If it is needed, then the dynamic shared
memory patch I posted probably needs it as well.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#9Abhijit Menon-Sen
ams@2ndQuadrant.com
In reply to: Richard Poole (#1)
[PATCH] Use MAP_HUGETLB where supported (v3)

Hi.

This is a slightly reworked version of the patch submitted by Richard
Poole last month, which was based on Christian Kruse's earlier patch.

Apart from doing various minor cleanups and documentation fixes, I also
tested this patch against HEAD on a machine with 256GB of RAM. Here's an
overview of the results.

I set nr_hugepages to 32768 (== 64GB), which (took a very long time and)
allowed me to set shared_buffers to 60GB. I then ran pgbench -s 1000 -i,
and did some runs of "pgbench -c 100 -j 10 -t 1000" with huge_tlb_pages
set to off and on respectively.

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.)

From /proc/$pid/status, VmPTE was 2880kb with huge_tlb_pages=off, and
56kb with it turned on.

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).

Any thoughts?

-- Abhijit

Attachments:

hugepages-v3.patchtext/x-diff; charset=us-asciiDownload+286-5
#10Abhijit Menon-Sen
ams@2ndQuadrant.com
In reply to: Abhijit Menon-Sen (#9)
Re: [PATCH] Use MAP_HUGETLB where supported (v3)

At 2013-10-24 11:33:13 +0530, ams@2ndquadrant.com wrote:

From /proc/$pid/status, VmPTE was 2880kb with huge_tlb_pages=off, and

56kb with it turned on.

(VmPTE is the size of the process's page tables.)

-- Abhijit

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#11Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Abhijit Menon-Sen (#9)
Re: [PATCH] Use MAP_HUGETLB where supported (v3)

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#12Robert Haas
robertmhaas@gmail.com
In reply to: Heikki Linnakangas (#11)
Re: [PATCH] Use MAP_HUGETLB where supported (v3)

On Thu, Oct 24, 2013 at 9:06 AM, Heikki Linnakangas
<hlinnakangas@vmware.com> wrote:

* 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.

This is true for dynamic shared memory, but not for the main shared
memory segment. The main shared memory segment is always the
combination of a small, fixed-size System V shared memory chunk and a
anonymous shared memory region created by mmap(NULL, ..., MAP_SHARED).
POSIX shared memory is not used.

(Exceptions: Anonymous shared memory isn't used on Windows, which has
its own mechanism, or when compiling with EXEC_BACKEND, when the whole
chunk is allocated as System V shared memory.)

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#13Andres Freund
andres@anarazel.de
In reply to: Heikki Linnakangas (#11)
Re: [PATCH] Use MAP_HUGETLB where supported (v3)

On 2013-10-24 16:06:19 +0300, Heikki Linnakangas wrote:

On 24.10.2013 09:03, Abhijit Menon-Sen wrote:

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).

But it's a range of relatively popular kernels, that will stay around
for a good while. So I am hesitant to just not do anything about it. The
directory scanning code isn't that bad imo.

Either way:
I think we should log when we tried to use hugepages but fell back to
plain mmap, currently it's hard to see whether they are used.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#14Robert Haas
robertmhaas@gmail.com
In reply to: Andres Freund (#13)
Re: [PATCH] Use MAP_HUGETLB where supported (v3)

On Thu, Oct 24, 2013 at 1:00 PM, Andres Freund <andres@2ndquadrant.com> wrote:

On 2013-10-24 16:06:19 +0300, Heikki Linnakangas wrote:

On 24.10.2013 09:03, Abhijit Menon-Sen wrote:

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).

But it's a range of relatively popular kernels, that will stay around
for a good while. So I am hesitant to just not do anything about it. The
directory scanning code isn't that bad imo.

Either way:
I think we should log when we tried to use hugepages but fell back to
plain mmap, currently it's hard to see whether they are used.

Logging it might be a good idea, but suppose the systems been running
for 6 months and you don't have the startup logs. Might be a good way
to have an easy way to discover later what happened back then.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#15Sergey Konoplev
gray.ru@gmail.com
In reply to: Abhijit Menon-Sen (#9)
Re: [PATCH] Use MAP_HUGETLB where supported (v3)

Hi,

On Wed, Oct 23, 2013 at 11:03 PM, Abhijit Menon-Sen <ams@2ndquadrant.com> 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.

Is it possible that this patch will be included in a minor version of
9.3? IMHO hugepages is a very important ability that postgres lost in
9.3, and it would be great to have it back ASAP.

Thank you.

--
Kind regards,
Sergey Konoplev
PostgreSQL Consultant and DBA

http://www.linkedin.com/in/grayhemp
+1 (415) 867-9984, +7 (901) 903-0499, +7 (988) 888-1979
gray.ru@gmail.com

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#16Tom Lane
tgl@sss.pgh.pa.us
In reply to: Sergey Konoplev (#15)
Re: [PATCH] Use MAP_HUGETLB where supported (v3)

Sergey Konoplev <gray.ru@gmail.com> writes:

On Wed, Oct 23, 2013 at 11:03 PM, Abhijit Menon-Sen <ams@2ndquadrant.com> 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.

Is it possible that this patch will be included in a minor version of
9.3? IMHO hugepages is a very important ability that postgres lost in
9.3, and it would be great to have it back ASAP.

Say what? There's never been any hugepages support in Postgres.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#17Abhijit Menon-Sen
ams@2ndQuadrant.com
In reply to: Heikki Linnakangas (#11)
Re: [PATCH] Use MAP_HUGETLB where supported (v3)

At 2013-10-24 16:06:19 +0300, hlinnakangas@vmware.com wrote:

Let's get rid of the rounding.

I share Andres's concern that the bug is present in various recent
kernels that are going to stick around for quite some time. Given
the rather significant performance gain, I think it's worth doing
something, though I'm not a big fan of the directory-scanning code
myself.

As a compromise, perhaps we can unconditionally round the size up to be
a multiple of 2MB? That way, we can use huge pages more often, but also
avoid putting in a lot of code and effort into the workaround and waste
only a little space (if any at all).

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.

You're right, guc.c doesn't use it any more; I've removed the #include.

sysv_shmem.c does use it (MAP_*, PROT_*), however, so I've left the test
in configure alone. I see that sys/mman.h is included elsewhere with an
#ifdef WIN32 or HAVE_SHM_OPEN guard, but HAVE_SYS_MMAN_H seems better.

* the documentation should perhaps mention that the setting only has
an effect if POSIX shared memory is used.

As Robert said, this is not correct, so I haven't changed anything.

-- Abhijit

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#18Abhijit Menon-Sen
ams@2ndQuadrant.com
In reply to: Andres Freund (#13)
Re: [PATCH] Use MAP_HUGETLB where supported (v3)

At 2013-10-24 19:00:28 +0200, andres@2ndquadrant.com wrote:

I think we should log when we tried to use hugepages but fell back to
plain mmap, currently it's hard to see whether they are used.

Good idea, thanks. I'll do this in the next patch I post (which will be
after we reach some consensus about how to handle the rounding problem).

-- Abhijit

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#19Sergey Konoplev
gray.ru@gmail.com
In reply to: Tom Lane (#16)
Re: [PATCH] Use MAP_HUGETLB where supported (v3)

On Tue, Oct 29, 2013 at 9:31 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Sergey Konoplev <gray.ru@gmail.com> writes:

On Wed, Oct 23, 2013 at 11:03 PM, Abhijit Menon-Sen <ams@2ndquadrant.com> 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.

Is it possible that this patch will be included in a minor version of
9.3? IMHO hugepages is a very important ability that postgres lost in
9.3, and it would be great to have it back ASAP.

Say what? There's never been any hugepages support in Postgres.

There were an ability to back shared memory with hugepages when using
<=9.2. I use it on ~30 servers for several years and it brings 8-17%
of performance depending on the memory size. Here you will find
several paragraphs of the description about how to do it
https://github.com/grayhemp/pgcookbook/blob/master/database_server_configuration.md.
Just search for the 'hugepages' word on the page.

--
Kind regards,
Sergey Konoplev
PostgreSQL Consultant and DBA

http://www.linkedin.com/in/grayhemp
+1 (415) 867-9984, +7 (901) 903-0499, +7 (988) 888-1979
gray.ru@gmail.com

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#20David Fetter
david@fetter.org
In reply to: Sergey Konoplev (#19)
Re: [PATCH] Use MAP_HUGETLB where supported (v3)

On Tue, Oct 29, 2013 at 11:08:05PM -0700, Sergey Konoplev wrote:

On Tue, Oct 29, 2013 at 9:31 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Sergey Konoplev <gray.ru@gmail.com> writes:

On Wed, Oct 23, 2013 at 11:03 PM, Abhijit Menon-Sen <ams@2ndquadrant.com> 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.

Is it possible that this patch will be included in a minor version of
9.3? IMHO hugepages is a very important ability that postgres lost in
9.3, and it would be great to have it back ASAP.

Say what? There's never been any hugepages support in Postgres.

There were an ability to back shared memory with hugepages when using
<=9.2. I use it on ~30 servers for several years and it brings 8-17%
of performance depending on the memory size. Here you will find
several paragraphs of the description about how to do it
https://github.com/grayhemp/pgcookbook/blob/master/database_server_configuration.md.
Just search for the 'hugepages' word on the page.

For better or worse, we add new features exactly and only in .0
releases. It's what's made it possible for people to plan
deployments, given us a deserved reputation for stability, etc., etc.

I guess what I'm saying here is that awesome as any particular feature
might be to back-patch, that benefit is overwhelmed by the cost of
having unstable releases.

-infininty from me to any proposal that gets us into "are you using
PostgreSQL x.y.z or x.y.w?" when it comes to features.

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#21David Fetter
david@fetter.org
In reply to: Abhijit Menon-Sen (#17)
#22Abhijit Menon-Sen
ams@2ndQuadrant.com
In reply to: David Fetter (#21)
#23Tom Lane
tgl@sss.pgh.pa.us
In reply to: Abhijit Menon-Sen (#17)
#24Tom Lane
tgl@sss.pgh.pa.us
In reply to: Sergey Konoplev (#19)
#25Abhijit Menon-Sen
ams@2ndQuadrant.com
In reply to: Tom Lane (#23)
#26Andres Freund
andres@anarazel.de
In reply to: Abhijit Menon-Sen (#25)
#27Sergey Konoplev
gray.ru@gmail.com
In reply to: Tom Lane (#24)
#28Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Sergey Konoplev (#27)
#29Sergey Konoplev
gray.ru@gmail.com
In reply to: Alvaro Herrera (#28)
#30Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Alvaro Herrera (#28)
#31Sergey Konoplev
gray.ru@gmail.com
In reply to: Alvaro Herrera (#30)
#32Sergey Konoplev
gray.ru@gmail.com
In reply to: Sergey Konoplev (#31)
#33Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Andres Freund (#26)
#34Sameer Kumar
sameer.kumar@ashnik.com
In reply to: Heikki Linnakangas (#33)
#35Abhijit Menon-Sen
ams@2ndQuadrant.com
In reply to: Heikki Linnakangas (#33)
#36Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Abhijit Menon-Sen (#35)
#37Andres Freund
andres@anarazel.de
In reply to: Alvaro Herrera (#36)
#38Robert Haas
robertmhaas@gmail.com
In reply to: Alvaro Herrera (#36)
#39Andres Freund
andres@anarazel.de
In reply to: Robert Haas (#38)
#40Abhijit Menon-Sen
ams@2ndQuadrant.com
In reply to: Andres Freund (#37)
#41Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Heikki Linnakangas (#33)
#42Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Alvaro Herrera (#41)
#43Christian Kruse
christian@2ndquadrant.com
In reply to: Heikki Linnakangas (#42)
#44Christian Kruse
christian@2ndquadrant.com
In reply to: Heikki Linnakangas (#33)
#45Christian Kruse
christian@2ndquadrant.com
In reply to: Christian Kruse (#44)
#46Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Christian Kruse (#45)
#47Vik Fearing
vik@postgresfriends.org
In reply to: Heikki Linnakangas (#46)
#48Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Vik Fearing (#47)
#49Merlin Moncure
mmoncure@gmail.com
In reply to: Christian Kruse (#43)
#50Jeff Janes
jeff.janes@gmail.com
In reply to: Heikki Linnakangas (#46)
#51Christian Kruse
christian@2ndquadrant.com
In reply to: Heikki Linnakangas (#46)
#52Christian Kruse
christian@2ndquadrant.com
In reply to: Jeff Janes (#50)
#53Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Christian Kruse (#52)
#54Christian Kruse
christian@2ndquadrant.com
In reply to: Heikki Linnakangas (#53)
#55Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Christian Kruse (#54)
#56Christian Kruse
christian@2ndquadrant.com
In reply to: Heikki Linnakangas (#55)
#57Christian Kruse
christian@2ndquadrant.com
In reply to: Christian Kruse (#51)
#58Peter Eisentraut
peter_e@gmx.net
In reply to: Christian Kruse (#57)
#59Robert Haas
robertmhaas@gmail.com
In reply to: Peter Eisentraut (#58)
#60Andres Freund
andres@anarazel.de
In reply to: Peter Eisentraut (#58)
#61Christian Kruse
christian@2ndquadrant.com
In reply to: Peter Eisentraut (#58)
#62Christian Kruse
christian@2ndquadrant.com
In reply to: Andres Freund (#60)
#63Peter Eisentraut
peter_e@gmx.net
In reply to: Christian Kruse (#62)
#64Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#63)
#65Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#64)
#66Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#65)
#67Christian Kruse
christian@2ndquadrant.com
In reply to: Andres Freund (#66)
#68Christian Kruse
christian@2ndquadrant.com
In reply to: Peter Eisentraut (#63)
#69Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Christian Kruse (#67)
#70Christian Kruse
christian@2ndquadrant.com
In reply to: Heikki Linnakangas (#69)
#71Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Heikki Linnakangas (#69)
#72Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Alvaro Herrera (#71)
#73Stephen Frost
sfrost@snowman.net
In reply to: Christian Kruse (#68)
#74Christian Kruse
christian@2ndquadrant.com
In reply to: Alvaro Herrera (#71)
#75Christian Kruse
christian@2ndquadrant.com
In reply to: Stephen Frost (#73)
#76Christian Kruse
christian@2ndquadrant.com
In reply to: Christian Kruse (#75)
#77Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Christian Kruse (#74)
In reply to: Heikki Linnakangas (#77)
#79Christian Kruse
christian@2ndquadrant.com
In reply to: Heikki Linnakangas (#77)
#80Christian Kruse
christian@2ndquadrant.com
In reply to: Peter Geoghegan (#78)
#81Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Christian Kruse (#79)
#82Christian Kruse
christian@2ndquadrant.com
In reply to: Heikki Linnakangas (#81)