Re: huge tlb support

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: YAMAMOTO Takashi <yamt(at)mwd(dot)biglobe(dot)ne(dot)jp>, robertmhaas(at)gmail(dot)com, andres(at)2ndquadrant(dot)com, pgsql-hackers(at)postgresql(dot)org, josh(at)agliodbs(dot)com
Subject: Re: huge tlb support
Date: 2012-07-09 07:15:18
Message-ID: 20120709071518.GA20317@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 09, 2012 at 02:11:00AM -0400, Tom Lane wrote:
> yamt(at)mwd(dot)biglobe(dot)ne(dot)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(at)svana(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Shigeru HANADA 2012-07-09 08:35:15 Re: [PATCH] Allow breaking out of hung connection attempts
Previous Message YAMAMOTO Takashi 2012-07-09 06:41:30 Re: huge tlb support