summaryrefslogtreecommitdiffstats
path: root/mm/swap.c
diff options
context:
space:
mode:
authorSteve Capper <steve.capper@arm.com>2016-04-29 01:18:24 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2016-04-29 04:34:04 +0200
commit66ee95d16a7f1b7b4f1dd74a2d81c6e19dc29a14 (patch)
tree332db216fb8774377e7fd012386e70df01d588ac /mm/swap.c
parentkexec: export OFFSET(page.compound_head) to find out compound tail page (diff)
downloadlinux-66ee95d16a7f1b7b4f1dd74a2d81c6e19dc29a14.tar.xz
linux-66ee95d16a7f1b7b4f1dd74a2d81c6e19dc29a14.zip
mm: exclude HugeTLB pages from THP page_mapped() logic
HugeTLB pages cannot be split, so we use the compound_mapcount to track rmaps. Currently page_mapped() will check the compound_mapcount, but will also go through the constituent pages of a THP compound page and query the individual _mapcount's too. Unfortunately, page_mapped() does not distinguish between HugeTLB and THP compound pages and assumes that a compound page always needs to have HPAGE_PMD_NR pages querying. For most cases when dealing with HugeTLB this is just inefficient, but for scenarios where the HugeTLB page size is less than the pmd block size (e.g. when using contiguous bit on ARM) this can lead to crashes. This patch adjusts the page_mapped function such that we skip the unnecessary THP reference checks for HugeTLB pages. Fixes: e1534ae95004 ("mm: differentiate page_mapped() from page_mapcount() for compound pages") Signed-off-by: Steve Capper <steve.capper@arm.com> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Michal Hocko <mhocko@suse.com> Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/swap.c')
0 files changed, 0 insertions, 0 deletions