Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1buRjD-0000fR-Di for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Oct 2016 22:10:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1buRjC-0007RR-R8 for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Oct 2016 22:10:22 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1buRjB-0007OF-Ex for pgsql-hackers@postgresql.org; Wed, 12 Oct 2016 22:10:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1buRj8-0000yf-W5 for pgsql-hackers@postgresql.org; Wed, 12 Oct 2016 22:10:20 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u9CMA5Ck009778; Wed, 12 Oct 2016 18:10:05 -0400 From: Tom Lane To: Alvaro Herrera cc: Andres Freund , pgsql-hackers@postgresql.org, Heikki Linnakangas , Abhijit Menon-Sen Subject: Re: munmap() failure due to sloppy handling of hugepage size In-reply-to: <20161012220432.GA943701@alvherre.pgsql> References: <20161012220432.GA943701@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Wed, 12 Oct 2016 19:04:32 -0300" Date: Wed, 12 Oct 2016 18:10:05 -0400 Message-ID: <9777.1476310205@sss.pgh.pa.us> X-Pg-Spam-Score: -2.2 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Alvaro Herrera 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