lkml.org 
[lkml]   [2013]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Transparent Hugepage Nit
Date
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.

-Andi
--
ak@linux.intel.com -- Speaking for myself only


\
 
 \ /
  Last update: 2013-01-15 23:01    [W:0.076 / U:0.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site