path: root/block/partitions
diff options
authorAndrea Arcangeli <>2013-10-16 13:46:56 -0700
committerLinus Torvalds <>2013-10-16 21:35:52 -0700
commitef5a22be2c525293b777ccd879a8017c41c7ed5a (patch)
tree5c44e6a22937b40b7fcf86fcd7c8cb08a50b633a /block/partitions
parentaa9bca05a467c61dcea4142b2877d5392de5bdce (diff)
mm: hugetlb: initialize PG_reserved for tail pages of gigantic compound pages
Commit 11feeb498086 ("kvm: optimize away THP checks in kvm_is_mmio_pfn()") introduced a memory leak when KVM is run on gigantic compound pages. That commit depends on the assumption that PG_reserved is identical for all head and tail pages of a compound page. So that if get_user_pages returns a tail page, we don't need to check the head page in order to know if we deal with a reserved page that requires different refcounting. The assumption that PG_reserved is the same for head and tail pages is certainly correct for THP and regular hugepages, but gigantic hugepages allocated through bootmem don't clear the PG_reserved on the tail pages (the clearing of PG_reserved is done later only if the gigantic hugepage is freed). This patch corrects the gigantic compound page initialization so that we can retain the optimization in 11feeb498086. The cacheline was already modified in order to set PG_tail so this won't affect the boot time of large memory systems. [ tweak comment layout and grammar] Signed-off-by: Andrea Arcangeli <> Reported-by: andy123 <> Acked-by: Rik van Riel <> Cc: Gleb Natapov <> Cc: Mel Gorman <> Cc: Hugh Dickins <> Acked-by: Rafael Aquini <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'block/partitions')
0 files changed, 0 insertions, 0 deletions