Re: [PATCH] mm hugetlb x86: fix hugepage memory leak in mincore()

Andrew Morton
2009-12-08T22:35:56Z

On Mon, 07 Dec 2009 16:59:14 +0900
Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> wrote:

> Most callers of pmd_none_or_clear_bad() check whether the target
> page is in a hugepage or not, but mincore() and walk_page_range()
> do not check it. So if we use mincore() on a hugepage on x86 machine,
> the hugepage memory is leaked as shown below.
> This patch fixes it by extending mincore() system call to support hugepages.

This bug is fairly embarrassing. I tagged the patch for a -stable
backport.