Re: [PATCH 00 of 66] Transparent Hugepage Support #32

From: Andrea Arcangeli
Date: Thu Nov 04 2010 - 12:32:31 EST


Hi Qian,

On Thu, Nov 04, 2010 at 04:41:12AM -0400, CAI Qian wrote:
> Thank Andrea for pointing out to me there are ongoing works for KSM
> and THP integration. Sorry for the noise.

No problem, thanks for your feedback!

The longer answer is: PageKsm pages will already co-exist fine with
PageTransHuge pages in the same vma with regular pages. So 3 type of
pages in the same vma. But before KSM scan can see the content of the
hugepages there has to be some memory pressure... So it's not ideal
and we will make KSM able to scan inside hugepages before they're
splitted (and to split them when it finds a match and then merge them
in the stable tree).

So it's perfectly normal that KSM becomes less effective when THP is
enabled. But in the mainline version we have MADV_HUGEPAGE, so if you
need KSM in full effect, you can simply "echo madvise
>/sys/kernel/mm/transparent_hugepage/enabled", and then you can decide
if to mark a mapping either with madvise(MADV_HUGEPAGE) or
madvise(MADV_MERGEABLE).

Thanks,
Andrea
--
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/