Messages in this thread | | | Date | Thu, 4 Nov 2010 17:30:26 +0100 | From | Andrea Arcangeli <> | Subject | Re: [PATCH 00 of 66] Transparent Hugepage Support #32 |
| |
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
| |