All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Landley <rob@landley.net>
To: Andi Kleen <andi@firstfloor.org>
Cc: John McCorquodale <mcq@rockgeek.org>, linux-kernel@vger.kernel.org
Subject: Re: Transparent Hugepage Nit
Date: Wed, 16 Jan 2013 09:50:20 -0600	[thread overview]
Message-ID: <1358351420.32505.35@driftwood> (raw)
In-Reply-To: <m2zk0ayw65.fsf@firstfloor.org> (from andi@firstfloor.org on Tue Jan 15 15:26:58 2013)

On 01/15/2013 03:26:58 PM, Andi Kleen wrote:
> John McCorquodale <mcq@rockgeek.org> writes:
> 
> > Suppose a hugepage-aligned mmap(MAP_ANONYMOUS) mapping has been  
> madvise()d
> > HUGEPAGE.  If a subeqeuent call to mremap() grows the mapping and  
> has to
> > move the mapping, the hugepage-alignment is not preserved in the  
> choice of
> > new address (in 3.7.2).
> >
> > I can workaround this by doing a 1-hugepage-oversized remap to find  
> a new
> > aligned address and then size it back down MREMAP_FIXED, but that's  
> probably
> > a lot of frags to 4k pages and back that aren't necessary.
> >
> > Should it not be the case that mremap(MAYMOVE) on something advised  
> hugepage
> > ALWAYS chooses a hugepage-aligned address?  This would be handy  
> when doing the
> > initial allocation too: mmap, madvise, mremap (to the same size) to  
> get
> > alignment.
> 
> The hole searching currently doesn't know anything about transparent
> huge pages. There were some discussions on fixing it. But it's
> essentially a trade off between memory fragmentation and huge page
> optimization: aggressively aligning to 2MB can lose address space
> in holes.
> 
> Usually if the program uses large enough mappings and enough memory
> it shouldn't be a problem.

Possibly we should just document that doing mremap() on a hugepage  
loses the hugepageness, and consider it pilot error to do that?

Rob

      reply	other threads:[~2013-01-16 16:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-15 20:50 Transparent Hugepage Nit John McCorquodale
2013-01-15 21:26 ` Andi Kleen
2013-01-16 15:50   ` Rob Landley [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1358351420.32505.35@driftwood \
    --to=rob@landley.net \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcq@rockgeek.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.