Commit 2b4910e9 authored by Liu Shixin's avatar Liu Shixin Committed by Zheng Zengkai
Browse files

mm/dynamic_hugetlb: only compile PG_pool on X86_64 and ARM64

hulk inclusion
category: bugfix
bugzilla: 46904, https://gitee.com/openeuler/kernel/issues/I4YXOA



--------------------------------

When building with defconfig on arm32, we got a compile error:
./include/linux/page-flags-layout.h:95:2: error: #error "Not enough bits in page flags"
   95 | #error "Not enough bits in page flags"
      |  ^~~~~

Limit PG_pool to compile only on X86_64 and ARM64 to resolve this issue.

Signed-off-by: default avatarLiu Shixin <liushixin2@huawei.com>
Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 8ea1372b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -220,7 +220,9 @@ u64 stable_page_flags(struct page *page)
#ifdef CONFIG_64BIT
	u |= kpf_copy_bit(k, KPF_ARCH_2,	PG_arch_2);
#endif
#if defined(CONFIG_X86_64) || defined(CONFIG_ARM64)
	u |= kpf_copy_bit(k, KPF_POOL,		PG_pool);
#endif

	return u;
};
+6 −0
Original line number Diff line number Diff line
@@ -139,7 +139,9 @@ enum pageflags {
#ifdef CONFIG_64BIT
	PG_arch_2,
#endif
#if defined(CONFIG_X86_64) || defined(CONFIG_ARM64)
	PG_pool,		/* Used to track page allocated from dynamic hugetlb pool */
#endif
#ifdef CONFIG_PIN_MEMORY
	PG_hotreplace,
#endif
@@ -474,7 +476,11 @@ __PAGEFLAG(Reported, reported, PF_NO_COMPOUND)
/*
 * PagePool() is used to track page allocated from hpool.
 */
#if defined(CONFIG_X86_64) || defined(CONFIG_ARM64)
PAGEFLAG(Pool, pool, PF_NO_TAIL)
#else
PAGEFLAG_FALSE(Pool)
#endif

/*
 * On an anonymous page mapped into a user virtual memory area,
+8 −2
Original line number Diff line number Diff line
@@ -87,6 +87,12 @@
#define IF_HAVE_PG_ARCH_2(flag,string)
#endif

#if defined(CONFIG_X86_64) || defined(CONFIG_ARM64)
#define IF_HAVE_PG_POOL(flag,string) ,{1UL << flag, string}
#else
#define IF_HAVE_PG_POOL(flag,string)
#endif

#ifdef CONFIG_PIN_MEMORY
#define IF_HAVE_PG_HOTREPLACE(flag, string) ,{1UL << flag, string}
#else
@@ -114,14 +120,14 @@
	{1UL << PG_mappedtodisk,	"mappedtodisk"	},		\
	{1UL << PG_reclaim,		"reclaim"	},		\
	{1UL << PG_swapbacked,		"swapbacked"	},		\
	{1UL << PG_unevictable,		"unevictable"	},		\
	{1UL << PG_pool,		"pool"		}		\
	{1UL << PG_unevictable,		"unevictable"	}		\
IF_HAVE_PG_MLOCK(PG_mlocked,		"mlocked"	)		\
IF_HAVE_PG_UNCACHED(PG_uncached,	"uncached"	)		\
IF_HAVE_PG_HWPOISON(PG_hwpoison,	"hwpoison"	)		\
IF_HAVE_PG_IDLE(PG_young,		"young"		)		\
IF_HAVE_PG_IDLE(PG_idle,		"idle"		)		\
IF_HAVE_PG_ARCH_2(PG_arch_2,		"arch_2"	)		\
IF_HAVE_PG_POOL(PG_pool,		"pool"		)		\
IF_HAVE_PG_HOTREPLACE(PG_hotreplace,	"hotreplace"	),		\
	{1UL << PG_reserve_pgflag_0,	"reserve_pgflag_0"},		\
	{1UL << PG_reserve_pgflag_1,	"reserve_pgflag_1"}