@@ -1826,6 +1826,7 @@ static int memcg_numa_stat_show(struct seq_file *m, void *v)
struct memcg_ksm_stat {
unsigned long ksm_rmap_items;
long ksm_zero_pages;
+ unsigned long ksm_merging_pages;
};
static int evaluate_memcg_ksm_stat(struct task_struct *task, void *arg)
@@ -1837,6 +1838,7 @@ static int evaluate_memcg_ksm_stat(struct task_struct *task, void *arg)
if (mm) {
ksm_stat->ksm_rmap_items += mm->ksm_rmap_items;
ksm_stat->ksm_zero_pages += mm_ksm_zero_pages(mm);
+ ksm_stat->ksm_merging_pages += mm->ksm_merging_pages;
mmput(mm);
}
@@ -1851,12 +1853,14 @@ static int memcg_ksm_stat_show(struct seq_file *m, void *v)
/* Initialization */
ksm_stat.ksm_rmap_items = 0;
ksm_stat.ksm_zero_pages = 0;
+ ksm_stat.ksm_merging_pages = 0;
/* summing all processes'ksm statistic items of this cgroup hierarchy */
mem_cgroup_scan_tasks(memcg, evaluate_memcg_ksm_stat, &ksm_stat);
seq_printf(m, "ksm_rmap_items %lu\n", ksm_stat.ksm_rmap_items);
seq_printf(m, "ksm_zero_pages %ld\n", ksm_stat.ksm_zero_pages);
+ seq_printf(m, "ksm_merging_pages %ld\n", ksm_stat.ksm_merging_pages);
return 0;
}