Skip to content

Commit 461a718

Browse files
Yisheng Xietorvalds
authored andcommitted
mm/hugetlb: introduce ARCH_HAS_GIGANTIC_PAGE
Avoid making ifdef get pretty unwieldy if many ARCHs support gigantic page. No functional change with this patch. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Yisheng Xie <[email protected]> Suggested-by: Michal Hocko <[email protected]> Acked-by: Michal Hocko <[email protected]> Acked-by: Naoya Horiguchi <[email protected]> Acked-by: Hillf Danton <[email protected]> Cc: Hanjun Guo <[email protected]> Cc: Will Deacon <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Sudeep Holla <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Rob Herring <[email protected]> Cc: Mike Kravetz <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 82e7d3a commit 461a718

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

arch/s390/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ config S390
7171
select ARCH_HAS_DEVMEM_IS_ALLOWED
7272
select ARCH_HAS_ELF_RANDOMIZE
7373
select ARCH_HAS_GCOV_PROFILE_ALL
74+
select ARCH_HAS_GIGANTIC_PAGE
7475
select ARCH_HAS_KCOV
7576
select ARCH_HAS_SG_CHAIN
7677
select ARCH_HAS_UBSAN_SANITIZE_ALL

arch/x86/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ config X86
2828
select ARCH_HAS_ELF_RANDOMIZE
2929
select ARCH_HAS_FAST_MULTIPLIER
3030
select ARCH_HAS_GCOV_PROFILE_ALL
31+
select ARCH_HAS_GIGANTIC_PAGE if X86_64
3132
select ARCH_HAS_KCOV if X86_64
3233
select ARCH_HAS_PMEM_API if X86_64
3334
select ARCH_HAS_MMIO_FLUSH

fs/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ config HUGETLBFS
200200
config HUGETLB_PAGE
201201
def_bool HUGETLBFS
202202

203+
config ARCH_HAS_GIGANTIC_PAGE
204+
bool
205+
203206
source "fs/configfs/Kconfig"
204207
source "fs/efivarfs/Kconfig"
205208

mm/hugetlb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ static int hstate_next_node_to_free(struct hstate *h, nodemask_t *nodes_allowed)
10221022
((node = hstate_next_node_to_free(hs, mask)) || 1); \
10231023
nr_nodes--)
10241024

1025-
#if (defined(CONFIG_X86_64) || defined(CONFIG_S390)) && \
1025+
#if defined(CONFIG_ARCH_HAS_GIGANTIC_PAGE) && \
10261026
((defined(CONFIG_MEMORY_ISOLATION) && defined(CONFIG_COMPACTION)) || \
10271027
defined(CONFIG_CMA))
10281028
static void destroy_compound_gigantic_page(struct page *page,

0 commit comments

Comments
 (0)