提交 a719240e 编写于 作者: L liubo 提交者: Zheng Zengkai

etmem: add CONFIG_ETMEM macro definition for etmem feature

euleros inclusion
category: feature
eature: etmem
bugzilla: https://gitee.com/openeuler/kernel/issues/I5DC4A

-------------------------------------------------
add CONFIG_ETMEM macro definition for etmem feature.
Signed-off-by: Nliubo <liubo254@huawei.com>
Reviewed-by: NMiaohe Lin <linmiaohe@huawei.com>
Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 cc3cdb36
...@@ -3338,6 +3338,8 @@ static const struct pid_entry tgid_base_stuff[] = { ...@@ -3338,6 +3338,8 @@ static const struct pid_entry tgid_base_stuff[] = {
REG("smaps", S_IRUGO, proc_pid_smaps_operations), REG("smaps", S_IRUGO, proc_pid_smaps_operations),
REG("smaps_rollup", S_IRUGO, proc_pid_smaps_rollup_operations), REG("smaps_rollup", S_IRUGO, proc_pid_smaps_rollup_operations),
REG("pagemap", S_IRUSR, proc_pagemap_operations), REG("pagemap", S_IRUSR, proc_pagemap_operations),
#endif
#ifdef CONFIG_ETMEM
REG("idle_pages", S_IRUSR|S_IWUSR, proc_mm_idle_operations), REG("idle_pages", S_IRUSR|S_IWUSR, proc_mm_idle_operations),
REG("swap_pages", S_IWUSR, proc_mm_swap_operations), REG("swap_pages", S_IWUSR, proc_mm_swap_operations),
#endif #endif
...@@ -3689,6 +3691,8 @@ static const struct pid_entry tid_base_stuff[] = { ...@@ -3689,6 +3691,8 @@ static const struct pid_entry tid_base_stuff[] = {
REG("smaps", S_IRUGO, proc_pid_smaps_operations), REG("smaps", S_IRUGO, proc_pid_smaps_operations),
REG("smaps_rollup", S_IRUGO, proc_pid_smaps_rollup_operations), REG("smaps_rollup", S_IRUGO, proc_pid_smaps_rollup_operations),
REG("pagemap", S_IRUSR, proc_pagemap_operations), REG("pagemap", S_IRUSR, proc_pagemap_operations),
#endif
#ifdef CONFIG_ETMEM
REG("idle_pages", S_IRUSR|S_IWUSR, proc_mm_idle_operations), REG("idle_pages", S_IRUSR|S_IWUSR, proc_mm_idle_operations),
REG("swap_pages", S_IWUSR, proc_mm_swap_operations), REG("swap_pages", S_IWUSR, proc_mm_swap_operations),
#endif #endif
......
...@@ -304,8 +304,10 @@ extern const struct file_operations proc_pid_smaps_operations; ...@@ -304,8 +304,10 @@ extern const struct file_operations proc_pid_smaps_operations;
extern const struct file_operations proc_pid_smaps_rollup_operations; extern const struct file_operations proc_pid_smaps_rollup_operations;
extern const struct file_operations proc_clear_refs_operations; extern const struct file_operations proc_clear_refs_operations;
extern const struct file_operations proc_pagemap_operations; extern const struct file_operations proc_pagemap_operations;
#ifdef CONFIG_ETMEM
extern const struct file_operations proc_mm_idle_operations; extern const struct file_operations proc_mm_idle_operations;
extern const struct file_operations proc_mm_swap_operations; extern const struct file_operations proc_mm_swap_operations;
#endif
extern unsigned long task_vsize(struct mm_struct *); extern unsigned long task_vsize(struct mm_struct *);
extern unsigned long task_statm(struct mm_struct *, extern unsigned long task_statm(struct mm_struct *,
......
...@@ -1855,6 +1855,7 @@ const struct file_operations proc_pagemap_operations = { ...@@ -1855,6 +1855,7 @@ const struct file_operations proc_pagemap_operations = {
.release = pagemap_release, .release = pagemap_release,
}; };
#ifdef CONFIG_ETMEM
static DEFINE_SPINLOCK(scan_lock); static DEFINE_SPINLOCK(scan_lock);
static int page_scan_lock(struct file *file, int is_lock, struct file_lock *flock) static int page_scan_lock(struct file *file, int is_lock, struct file_lock *flock)
...@@ -2037,6 +2038,7 @@ const struct file_operations proc_mm_swap_operations = { ...@@ -2037,6 +2038,7 @@ const struct file_operations proc_mm_swap_operations = {
.open = mm_swap_open, .open = mm_swap_open,
.release = mm_swap_release, .release = mm_swap_release,
}; };
#endif
#endif /* CONFIG_PROC_PAGE_MONITOR */ #endif /* CONFIG_PROC_PAGE_MONITOR */
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
......
...@@ -383,9 +383,11 @@ extern int vm_swappiness; ...@@ -383,9 +383,11 @@ extern int vm_swappiness;
extern int remove_mapping(struct address_space *mapping, struct page *page); extern int remove_mapping(struct address_space *mapping, struct page *page);
extern unsigned long reclaim_pages(struct list_head *page_list); extern unsigned long reclaim_pages(struct list_head *page_list);
#ifdef CONFIG_ETMEM
extern int add_page_for_swap(struct page *page, struct list_head *pagelist); extern int add_page_for_swap(struct page *page, struct list_head *pagelist);
extern struct page *get_page_from_vaddr(struct mm_struct *mm, extern struct page *get_page_from_vaddr(struct mm_struct *mm,
unsigned long vaddr); unsigned long vaddr);
#endif
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
extern int node_reclaim_mode; extern int node_reclaim_mode;
extern int sysctl_min_unmapped_ratio; extern int sysctl_min_unmapped_ratio;
......
...@@ -4582,6 +4582,7 @@ void check_move_unevictable_pages(struct pagevec *pvec) ...@@ -4582,6 +4582,7 @@ void check_move_unevictable_pages(struct pagevec *pvec)
} }
EXPORT_SYMBOL_GPL(check_move_unevictable_pages); EXPORT_SYMBOL_GPL(check_move_unevictable_pages);
#ifdef CONFIG_ETMEM
int add_page_for_swap(struct page *page, struct list_head *pagelist) int add_page_for_swap(struct page *page, struct list_head *pagelist)
{ {
int err = -EBUSY; int err = -EBUSY;
...@@ -4636,3 +4637,4 @@ struct page *get_page_from_vaddr(struct mm_struct *mm, unsigned long vaddr) ...@@ -4636,3 +4637,4 @@ struct page *get_page_from_vaddr(struct mm_struct *mm, unsigned long vaddr)
return page; return page;
} }
EXPORT_SYMBOL_GPL(get_page_from_vaddr); EXPORT_SYMBOL_GPL(get_page_from_vaddr);
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册