OSDN Git Service

arm64/hugetlb: Reserve CMA areas for gigantic pages on 16K and 64K configs
authorAnshuman Khandual <anshuman.khandual@arm.com>
Wed, 1 Jul 2020 04:42:01 +0000 (10:12 +0530)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 15 Jul 2020 12:38:03 +0000 (13:38 +0100)
commitabb7962adc80ab4f4313e8a065302525b6a9c2dc
tree0fb04418c6b234ba515c8b38abdd2c4080ae4d48
parent0de674afe83cb23676ec391470251aaa9700f21a
arm64/hugetlb: Reserve CMA areas for gigantic pages on 16K and 64K configs

Currently 'hugetlb_cma=' command line argument does not create CMA area on
ARM64_16K_PAGES and ARM64_64K_PAGES based platforms. Instead, it just ends
up with the following warning message. Reason being, hugetlb_cma_reserve()
never gets called for these huge page sizes.

[   64.255669] hugetlb_cma: the option isn't supported by current arch

This enables CMA areas reservation on ARM64_16K_PAGES and ARM64_64K_PAGES
configs by defining an unified arm64_hugetlb_cma_reseve() that is wrapped
in CONFIG_CMA. Call site for arm64_hugetlb_cma_reserve() is also protected
as <asm/hugetlb.h> is conditionally included and hence cannot contain stub
for the inverse config i.e !(CONFIG_HUGETLB_PAGE && CONFIG_CMA).

Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Barry Song <song.bao.hua@hisilicon.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Link: https://lore.kernel.org/r/1593578521-24672-1-git-send-email-anshuman.khandual@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/hugetlb.h
arch/arm64/mm/hugetlbpage.c
arch/arm64/mm/init.c