Commit c4b558d5 authored by Liu Shixin's avatar Liu Shixin
Browse files

mm/dynamic_pool: introduce PG_pool to mark pages allocated from dpool

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8S9BY


CVE: NA

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

Add a new page_flag PG_pool to represent the page allocated from dpool.

Signed-off-by: default avatarLiu Shixin <liushixin2@huawei.com>
parent aeb5fd3e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -222,6 +222,9 @@ u64 stable_page_flags(struct page *page)
	u |= kpf_copy_bit(k, KPF_ARCH_2,	PG_arch_2);
	u |= kpf_copy_bit(k, KPF_ARCH_3,	PG_arch_3);
#endif
#ifdef CONFIG_DYNAMIC_POOL
	u |= kpf_copy_bit(k, KPF_POOL,		PG_pool);
#endif

	return u;
};
+12 −0
Original line number Diff line number Diff line
@@ -135,6 +135,9 @@ enum pageflags {
#ifdef CONFIG_ARCH_USES_PG_ARCH_X
	PG_arch_2,
	PG_arch_3,
#endif
#ifdef CONFIG_DYNAMIC_POOL
	PG_pool,		/* Page is allocated from dynamic pool */
#endif
	__NR_PAGEFLAGS,

@@ -603,6 +606,15 @@ PAGEFLAG(VmemmapSelfHosted, vmemmap_self_hosted, PF_ANY)
PAGEFLAG_FALSE(VmemmapSelfHosted, vmemmap_self_hosted)
#endif

/*
 * PagePool() is used to track page allocated from dpool.
 */
#ifdef CONFIG_DYNAMIC_POOL
PAGEFLAG(Pool, pool, PF_NO_TAIL)
#else
PAGEFLAG_FALSE(Pool, pool)
#endif

/*
 * On an anonymous page mapped into a user virtual memory area,
 * page->mapping points to its anon_vma, not to a struct address_space;
+7 −0
Original line number Diff line number Diff line
@@ -90,6 +90,12 @@
#define IF_HAVE_PG_IDLE(_name)
#endif

#ifdef CONFIG_DYNAMIC_POOL
#define IF_HAVE_PG_POOL(_name) ,{1UL << PG_##_name, __stringify(_name)}
#else
#define IF_HAVE_PG_POOL(_name)
#endif

#ifdef CONFIG_ARCH_USES_PG_ARCH_X
#define IF_HAVE_PG_ARCH_X(_name) ,{1UL << PG_##_name, __stringify(_name)}
#else
@@ -125,6 +131,7 @@ IF_HAVE_PG_UNCACHED(uncached) \
IF_HAVE_PG_HWPOISON(hwpoison)						\
IF_HAVE_PG_IDLE(idle)							\
IF_HAVE_PG_IDLE(young)							\
IF_HAVE_PG_POOL(pool)							\
IF_HAVE_PG_ARCH_X(arch_2)						\
IF_HAVE_PG_ARCH_X(arch_3)

+1 −0
Original line number Diff line number Diff line
@@ -36,5 +36,6 @@
#define KPF_ZERO_PAGE		24
#define KPF_IDLE		25
#define KPF_PGTABLE		26
#define KPF_POOL		27

#endif /* _UAPILINUX_KERNEL_PAGE_FLAGS_H */
+1 −0
Original line number Diff line number Diff line
@@ -126,6 +126,7 @@ static const char * const page_flag_names[] = {
	[KPF_PGTABLE]		= "g:pgtable",
	[KPF_ZERO_PAGE]		= "z:zero_page",
	[KPF_IDLE]              = "i:idle_page",
	[KPF_POOL]		= "p:pool",

	[KPF_RESERVED]		= "r:reserved",
	[KPF_MLOCKED]		= "m:mlocked",