提交 4232d900 编写于 作者: 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>
上级 3f29b698
......@@ -3338,6 +3338,8 @@ static const struct pid_entry tgid_base_stuff[] = {
REG("smaps", S_IRUGO, proc_pid_smaps_operations),
REG("smaps_rollup", S_IRUGO, proc_pid_smaps_rollup_operations),
REG("pagemap", S_IRUSR, proc_pagemap_operations),
#endif
#ifdef CONFIG_ETMEM
REG("idle_pages", S_IRUSR|S_IWUSR, proc_mm_idle_operations),
REG("swap_pages", S_IWUSR, proc_mm_swap_operations),
#endif
......@@ -3689,6 +3691,8 @@ static const struct pid_entry tid_base_stuff[] = {
REG("smaps", S_IRUGO, proc_pid_smaps_operations),
REG("smaps_rollup", S_IRUGO, proc_pid_smaps_rollup_operations),
REG("pagemap", S_IRUSR, proc_pagemap_operations),
#endif
#ifdef CONFIG_ETMEM
REG("idle_pages", S_IRUSR|S_IWUSR, proc_mm_idle_operations),
REG("swap_pages", S_IWUSR, proc_mm_swap_operations),
#endif
......
......@@ -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_clear_refs_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_swap_operations;
#endif
extern unsigned long task_vsize(struct mm_struct *);
extern unsigned long task_statm(struct mm_struct *,
......
......@@ -1855,6 +1855,7 @@ const struct file_operations proc_pagemap_operations = {
.release = pagemap_release,
};
#ifdef CONFIG_ETMEM
static DEFINE_SPINLOCK(scan_lock);
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 = {
.open = mm_swap_open,
.release = mm_swap_release,
};
#endif
#endif /* CONFIG_PROC_PAGE_MONITOR */
#ifdef CONFIG_NUMA
......
......@@ -384,9 +384,11 @@ extern int vm_swappiness;
extern int remove_mapping(struct address_space *mapping, struct page *page);
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 struct page *get_page_from_vaddr(struct mm_struct *mm,
unsigned long vaddr);
#endif
#ifdef CONFIG_NUMA
extern int node_reclaim_mode;
extern int sysctl_min_unmapped_ratio;
......
......@@ -4539,6 +4539,7 @@ void check_move_unevictable_pages(struct pagevec *pvec)
}
EXPORT_SYMBOL_GPL(check_move_unevictable_pages);
#ifdef CONFIG_ETMEM
int add_page_for_swap(struct page *page, struct list_head *pagelist)
{
int err = -EBUSY;
......@@ -4593,6 +4594,7 @@ struct page *get_page_from_vaddr(struct mm_struct *mm, unsigned long vaddr)
return page;
}
EXPORT_SYMBOL_GPL(get_page_from_vaddr);
#endif
#ifdef CONFIG_PAGE_CACHE_LIMIT
unsigned long page_cache_shrink_memory(unsigned long nr_to_reclaim,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册