Transparent Hugepage Nit

From: John McCorquodale
Date: Tue Jan 15 2013 - 15:59:39 EST


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.

Cheers,

-mcq
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/