提交 2cef14da 编写于 作者: J Jingxian He 提交者: Zheng Zengkai

mm/pin_mem: add PG_hotreplace to mark pages need hotreplaced

euleros inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4QPBH
CVE: NA

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

Use PG_hotreplace flag to mark pin pages which need to be hotreplaced
to the recover process.
Signed-off-by: NJingxian He <hejingxian@huawei.com>
Reviewed-by: Kefeng Wang<wangkefeng.wang@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 b76aa450
...@@ -140,6 +140,9 @@ enum pageflags { ...@@ -140,6 +140,9 @@ enum pageflags {
PG_arch_2, PG_arch_2,
#endif #endif
PG_pool, /* Used to track page allocated from dynamic hugetlb pool */ PG_pool, /* Used to track page allocated from dynamic hugetlb pool */
#ifdef CONFIG_PIN_MEMORY
PG_hotreplace,
#endif
/* Add reserved page flags for internal extension. For the new page /* Add reserved page flags for internal extension. For the new page
* flags which backported from kernel upstream, please place them * flags which backported from kernel upstream, please place them
...@@ -431,6 +434,12 @@ PAGEFLAG_FALSE(Mlocked) __CLEARPAGEFLAG_NOOP(Mlocked) ...@@ -431,6 +434,12 @@ PAGEFLAG_FALSE(Mlocked) __CLEARPAGEFLAG_NOOP(Mlocked)
TESTSCFLAG_FALSE(Mlocked) TESTSCFLAG_FALSE(Mlocked)
#endif #endif
#ifdef CONFIG_PIN_MEMORY
PAGEFLAG(Hotreplace, hotreplace, PF_ANY)
#else
PAGEFLAG_FALSE(Hotreplace)
#endif
#ifdef CONFIG_ARCH_USES_PG_UNCACHED #ifdef CONFIG_ARCH_USES_PG_UNCACHED
PAGEFLAG(Uncached, uncached, PF_NO_COMPOUND) PAGEFLAG(Uncached, uncached, PF_NO_COMPOUND)
#else #else
......
...@@ -87,6 +87,12 @@ ...@@ -87,6 +87,12 @@
#define IF_HAVE_PG_ARCH_2(flag,string) #define IF_HAVE_PG_ARCH_2(flag,string)
#endif #endif
#ifdef CONFIG_PIN_MEMORY
#define IF_HAVE_PG_HOTREPLACE(flag, string) ,{1UL << flag, string}
#else
#define IF_HAVE_PG_HOTREPLACE(flag, string)
#endif
#define __def_pageflag_names \ #define __def_pageflag_names \
{1UL << PG_locked, "locked" }, \ {1UL << PG_locked, "locked" }, \
{1UL << PG_waiters, "waiters" }, \ {1UL << PG_waiters, "waiters" }, \
...@@ -115,7 +121,8 @@ IF_HAVE_PG_UNCACHED(PG_uncached, "uncached" ) \ ...@@ -115,7 +121,8 @@ IF_HAVE_PG_UNCACHED(PG_uncached, "uncached" ) \
IF_HAVE_PG_HWPOISON(PG_hwpoison, "hwpoison" ) \ IF_HAVE_PG_HWPOISON(PG_hwpoison, "hwpoison" ) \
IF_HAVE_PG_IDLE(PG_young, "young" ) \ IF_HAVE_PG_IDLE(PG_young, "young" ) \
IF_HAVE_PG_IDLE(PG_idle, "idle" ) \ IF_HAVE_PG_IDLE(PG_idle, "idle" ) \
IF_HAVE_PG_ARCH_2(PG_arch_2, "arch_2" ), \ IF_HAVE_PG_ARCH_2(PG_arch_2, "arch_2" ) \
IF_HAVE_PG_HOTREPLACE(PG_hotreplace, "hotreplace" ), \
{1UL << PG_reserve_pgflag_0, "reserve_pgflag_0"}, \ {1UL << PG_reserve_pgflag_0, "reserve_pgflag_0"}, \
{1UL << PG_reserve_pgflag_1, "reserve_pgflag_1"} {1UL << PG_reserve_pgflag_1, "reserve_pgflag_1"}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册