From: Michael Heaney <mheaney@jcvi.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: Huge pages not working on PG 9.4
Date: Sat, 17 Jan 2015 10:55:01 -0500
Message-ID: <54BA85D5.90505@jcvi.org> (raw)
In-Reply-To: <2824.1421466757@sss.pgh.pa.us>
References: <54B98BB5.4050902@jcvi.org>
<73DC9DCF-7C2D-49F7-8E8C-19F9C9E13854@elevated-dev.com>
<54B991F5.7040505@jcvi.org>
<54B995CE.5010301@jcvi.org>
<28981.1421452694@sss.pgh.pa.us>
<54B9C41D.10109@jcvi.org>
<2824.1421466757@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>
On 1/16/2015 10:52 PM, Tom Lane wrote:
> Michael Heaney <mheaney@jcvi.org> writes:
>> On 1/16/2015 6:58 PM, Tom Lane wrote:
>>> A quick look at the PG source code says that that message means that
>>> MAP_HUGETLB isn't defined. Our code is expecting <sys/mman.h> to provide
>>> that symbol, which it should do by default according to what I can see on
>>> my RHEL 6.6 box. Perhaps you've defined some of the feature restriction
>>> macros like _POSIX_SOURCE?
>> Thanks for the helpful clue, Tom. I haven't knowingly defined
>> _POSIX_SOURCE or any other macros. I go through the same configure/make
>> process on the Centos 6.6 VM on my home PC, and huge pages works just
>> fine. Maybe it's an issue with CentOS 6.4?
> Dunno, hard to believe that hugetlb support wasn't there in 6.4. A quick
> troll through the RHEL 6.5 and 6.6 release notes finds something about
> better hugetlb support for System Z processors, but what we're discussing
> here shouldn't be architecture-specific.
>
> You might try comparing /usr/include/sys/mman.h, /usr/include/bits/mman.h,
> and /usr/include/features.h between your 6.4 and 6.6 systems to see if
> you can spot any relevant differences.
>
> regards, tom lane
Nice catch! The following line was missing from /usr/include/bits/mman.h
on CentOS 6.4:
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
I added it to a test 6.4 box, and the rebuilt Postgres was then able to
use huge pages.
I'm leery about adding this to all the 6.4 boxes, though, without some
reassurance that it won't break something. I'll bring it up with my
Linux SA's next week. Thanks again for your help!
--
Michael Heaney
JCVI
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: mheaney@jcvi.org, tgl@sss.pgh.pa.us
Subject: Re: Huge pages not working on PG 9.4
In-Reply-To: <54BA85D5.90505@jcvi.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox