Swapin/swapout cannot be accounted by beancounters anymore, because memory management moved to memcg. Right now, these stats are not provided by memcg, so this patch simply drops them from /proc/vmstat inside container and from /proc/bc/CTID/vmaux on the host. If anybody requests these counters, they should be reimplemented in the scope of memcg and returned back.
Signed-off-by: Vladimir Davydov <vdavy...@parallels.com> --- include/bc/beancounter.h | 6 ------ kernel/bc/vm_pages.c | 31 +------------------------------ 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/include/bc/beancounter.h b/include/bc/beancounter.h index a4131e11c15c..0534c205967a 100644 --- a/include/bc/beancounter.h +++ b/include/bc/beancounter.h @@ -63,12 +63,6 @@ struct ub_percpu_struct { unsigned long fuse_requests; unsigned long fuse_bytes; - unsigned long swapin; - unsigned long swapout; - - unsigned long vswapin; - unsigned long vswapout; - #ifdef CONFIG_BC_IO_ACCOUNTING unsigned long async_write_complete; unsigned long async_write_canceled; diff --git a/kernel/bc/vm_pages.c b/kernel/bc/vm_pages.c index c52d34f377b5..23e874237206 100644 --- a/kernel/bc/vm_pages.c +++ b/kernel/bc/vm_pages.c @@ -220,18 +220,7 @@ out: static int bc_fill_vmstat(struct user_beancounter *ub, unsigned long *stat) { - int cpu; - - for_each_possible_cpu(cpu) { - struct ub_percpu_struct *pcpu = ub_percpu(ub, cpu); - - stat[NR_VM_ZONE_STAT_ITEMS + PSWPIN] += pcpu->swapin; - stat[NR_VM_ZONE_STAT_ITEMS + PSWPOUT] += pcpu->swapout; - - stat[NR_VM_ZONE_STAT_ITEMS + PSWPIN] += pcpu->vswapin; - stat[NR_VM_ZONE_STAT_ITEMS + PSWPOUT] += pcpu->vswapout; - } - + /* FIXME: show swapin/swapout? */ return NOTIFY_OK; } @@ -275,32 +264,14 @@ module_exit(fini_vmguar_notifier); static int bc_vmaux_show(struct seq_file *f, void *v) { struct user_beancounter *ub; - struct ub_percpu_struct *ub_pcpu; - unsigned long swapin, swapout, vswapin, vswapout; - int i; ub = seq_beancounter(f); ub_sync_memcg(ub); - swapin = swapout = vswapin = vswapout = 0; - for_each_possible_cpu(i) { - ub_pcpu = ub_percpu(ub, i); - swapin += ub_pcpu->swapin; - swapout += ub_pcpu->swapout; - vswapin += ub_pcpu->vswapin; - vswapout += ub_pcpu->vswapout; - } - seq_printf(f, bc_proc_lu_fmt, "tmpfs_respages", ub->ub_tmpfs_respages); - seq_printf(f, bc_proc_lu_fmt, "swapin", swapin); - seq_printf(f, bc_proc_lu_fmt, "swapout", swapout); - - seq_printf(f, bc_proc_lu_fmt, "vswapin", vswapin); - seq_printf(f, bc_proc_lu_fmt, "vswapout", vswapout); - seq_printf(f, bc_proc_lu_fmt, "ram", ub->ub_parms[UB_PHYSPAGES].held); return 0; -- 2.1.4 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel