mm: hugetlb: Copy huge_pmd_share from x86 to mm.
authorSteve Capper <steve.capper@linaro.org>
Tue, 23 Apr 2013 11:35:02 +0000 (12:35 +0100)
committerMark Brown <broonie@linaro.org>
Fri, 9 May 2014 11:02:46 +0000 (12:02 +0100)
commit5f525ac6a41ca1875b21f0c35bb9c540c00a11ab
tree408f1c38931a787de5698b6a4071832aec1d8f3d
parent8bb495e3f02401ee6f76d1b1d77f3ac9f079e376
mm: hugetlb: Copy huge_pmd_share from x86 to mm.

Under x86, multiple puds can be made to reference the same bank of
huge pmds provided that they represent a full PUD_SIZE of shared
huge memory that is aligned to a PUD_SIZE boundary.

The code to share pmds does not require any architecture specific
knowledge other than the fact that pmds can be indexed, thus can
be beneficial to some other architectures.

This patch copies the huge pmd sharing (and unsharing) logic from
x86/ to mm/ and introduces a new config option to activate it:
CONFIG_ARCH_WANTS_HUGE_PMD_SHARE

Signed-off-by: Steve Capper <steve.capper@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/hugetlb.h
mm/hugetlb.c