MADV_DONTNEED is currently disabled for hugetlb mappings. This certainly makes sense in shared file mappings as the pagecache maintains a reference to the page and it will never be freed. However, it could be useful to unmap and free pages in private mappings.
Mike Kravetz (2): mm: enable MADV_DONTNEED for hugetlb mappings madvise: use zap_page_range_single for madvise dontneed
Rik van Riel (1): mm,madvise,hugetlb: fix unexpected data loss with MADV_DONTNEED on hugetlbfs
include/linux/mm.h | 2 ++ mm/madvise.c | 47 +++++++++++++++++++++++++++++++++++++++++----- mm/memory.c | 14 +++++++++++--- 3 files changed, 55 insertions(+), 8 deletions(-)