pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org
Subject: Re: munmap() failure due to sloppy handling of hugepage size
Date: Thu, 13 Oct 2016 09:29:35 -0400
Message-ID: <30318.1476365375@sss.pgh.pa.us> (raw)
In-Reply-To: <20161012222335.hoquilnawqnu4t57@alap3.anarazel.de>
References: <31056.1476303954@sss.pgh.pa.us>
	<25C01331-B1AE-45A6-BD1F-D8AE2DE40F86@anarazel.de>
	<31426.1476304418@sss.pgh.pa.us>
	<20161012222335.hoquilnawqnu4t57@alap3.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Andres Freund <andres@anarazel.de> writes:
> On 2016-10-12 16:33:38 -0400, Tom Lane wrote:
>> Also, if you look into /sys then you are going to see multiple
>> possible values and it's not clear how to choose the right one.

> That's a fair point. It'd probably be good to use the largest we can,
> bounded by a percentage of max waste or such.  But that's likely
> something for another day.

Yeah.  Merlin pointed out that on versions of Linux newer than my
RHEL6 box, mmap accepts additional flag bits that let you specify
which hugepage size to use.  So we would need to use those if we
wanted to work with anything besides the default size.

Now AFAICT from the documentation I've seen, configuring hugepages
is all still pretty manual, ie the sysadmin has to set up so many huge
pages of each size at or near boot.  So I'm thinking that using a
non-default size should be something that happens only if the user
tells us to, ie we'd need to add a GUC saying "use size X".  That's
pretty ugly but if the admin is intending PG to use pages from a
certain pool, how else would we ensure that the right thing happens?
And it'd provide a way of overriding our default 2MB guess on non-Linux
platforms.

Anyway, anything involving a new GUC is certainly new-feature, HEAD-only
material.  I think though that reading the default hugepage size out of
/proc/meminfo is a back-patchable bug fix.

			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



view thread (10+ messages)

Message-ID: <30318.1476365375@sss.pgh.pa.us>
Permalink:  ../30318.1476365375@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/30318.1476365375@sss.pgh.pa.us

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de
  Subject: Re: munmap() failure due to sloppy handling of hugepage size
  In-Reply-To: <30318.1476365375@sss.pgh.pa.us>
  References: <31056.1476303954@sss.pgh.pa.us> <25C01331-B1AE-45A6-BD1F-D8AE2DE40F86@anarazel.de> <31426.1476304418@sss.pgh.pa.us> <20161012222335.hoquilnawqnu4t57@alap3.anarazel.de> <30318.1476365375@sss.pgh.pa.us>

* 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