提交 e3c2ab03 编写于 作者: L Liu Shixin 提交者: Zheng Zengkai

mm: add PG_pool in /proc/kpageflags

hulk inclusion
category: feature
bugzilla: 46904, https://gitee.com/openeuler/kernel/issues/I4RO84
CVE: NA

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

Export PG_pool page flag in /proc/kpageflags.

	27. KPF_POOL		page is allocated from hpool.

By using this tool, we can easily count the number of pages allocated from
dynamic hugetlb pool by a process or a file.
Signed-off-by: NLiu Shixin <liushixin2@huawei.com>
Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 a6610eed
...@@ -220,6 +220,7 @@ u64 stable_page_flags(struct page *page) ...@@ -220,6 +220,7 @@ u64 stable_page_flags(struct page *page)
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
u |= kpf_copy_bit(k, KPF_ARCH_2, PG_arch_2); u |= kpf_copy_bit(k, KPF_ARCH_2, PG_arch_2);
#endif #endif
u |= kpf_copy_bit(k, KPF_POOL, PG_pool);
return u; return u;
}; };
......
...@@ -36,5 +36,6 @@ ...@@ -36,5 +36,6 @@
#define KPF_ZERO_PAGE 24 #define KPF_ZERO_PAGE 24
#define KPF_IDLE 25 #define KPF_IDLE 25
#define KPF_PGTABLE 26 #define KPF_PGTABLE 26
#define KPF_POOL 27
#endif /* _UAPILINUX_KERNEL_PAGE_FLAGS_H */ #endif /* _UAPILINUX_KERNEL_PAGE_FLAGS_H */
...@@ -126,6 +126,7 @@ static const char * const page_flag_names[] = { ...@@ -126,6 +126,7 @@ static const char * const page_flag_names[] = {
[KPF_PGTABLE] = "g:pgtable", [KPF_PGTABLE] = "g:pgtable",
[KPF_ZERO_PAGE] = "z:zero_page", [KPF_ZERO_PAGE] = "z:zero_page",
[KPF_IDLE] = "i:idle_page", [KPF_IDLE] = "i:idle_page",
[KPF_POOL] = "h:hpool",
[KPF_RESERVED] = "r:reserved", [KPF_RESERVED] = "r:reserved",
[KPF_MLOCKED] = "m:mlocked", [KPF_MLOCKED] = "m:mlocked",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册