Re: huge tlb support - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: huge tlb support
Date
Msg-id 20120709071518.GA20317@svana.org
Whole thread Raw
In response to Re: huge tlb support  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Jul 09, 2012 at 02:11:00AM -0400, Tom Lane wrote:
> yamt@mwd.biglobe.ne.jp (YAMAMOTO Takashi) writes:
> >> Also, I was under the impression that recent Linux kernels use hugepages
> >> automatically if they can, so I wonder exactly what Andres was testing
> >> on ...
>
> > if you mean the "trasparent hugepage" feature, iirc it doesn't affect
> > MAP_SHARED mappings like this.
>
> Oh!  That would explain some things.  It seems like a pretty nasty
> restriction though ... do you know why they did that?

It doesn't say explicitly in the documentation (found at
http://lwn.net/Articles/423592/ aka transhuge.txt) but reading between
the lines I'm guessing it's due to the fact that huge pages must be
aligned to 2 or 4MB and when dealing with a shared mapping you probably
need to require it to be aligned is all address spaces.

However, it seems it should work for SysV shared memory, see:
http://lwn.net/Articles/375096/ .  The same page suggests shared
mappings should work fine.  However, this page refers to the
non-transparent feature.

If you think about it, it must work since huge pages are inherited
through fork().

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> He who writes carelessly confesses thereby at the very outset that he does
> not attach much importance to his own thoughts.  -- Arthur Schopenhauer

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: huge tlb support
Next
From: Shigeru HANADA
Date:
Subject: Re: [PATCH] Allow breaking out of hung connection attempts