pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Abhijit Menon-Sen <ams@2ndquadrant.com>
Subject: Re: munmap() failure due to sloppy handling of hugepage size
Date: Wed, 12 Oct 2016 18:10:05 -0400
Message-ID: <9777.1476310205@sss.pgh.pa.us> (raw)
In-Reply-To: <20161012220432.GA943701@alvherre.pgsql>
References: <20161012220432.GA943701@alvherre.pgsql>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> Tom Lane wrote:
>> According to
>> https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt
>> looking into /proc/meminfo is the longer-standing API and thus is
>> likely to work on more kernel versions.  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.

> I'm not sure that this is the best rationale.  In my system there are
> 2MB and 1GB huge page sizes; in systems with lots of memory (let's say 8
> GB of shared memory is requested) it seems a clear winner to allocate 8
> 1GB hugepages than 4096 2MB hugepages because the page table is so much
> smaller.  The /proc interface only shows the 2MB page size, so if we go
> that route we'd not be getting the full benefit of the feature.

And you'll tell mmap() which one to do how exactly?  I haven't found
anything explaining how applications get to choose which page size applies
to their request.  The kernel document says that /proc/meminfo reflects
the "default" size, and I'd assume that that's what we'll get from mmap.

			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)  latest in thread

Message-ID: <9777.1476310205@sss.pgh.pa.us>
Permalink:  ../9777.1476310205@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9777.1476310205@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, alvherre@2ndquadrant.com, andres@anarazel.de, hlinnaka@iki.fi, ams@2ndquadrant.com
  Subject: Re: munmap() failure due to sloppy handling of hugepage size
  In-Reply-To: <9777.1476310205@sss.pgh.pa.us>
  References: <20161012220432.GA943701@alvherre.pgsql> <9777.1476310205@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