diff -NurpP --minimal linux-4.9.76-vs2.3.9.5.2/include/linux/memcontrol.h linux-4.9.76-vs2.3.9.5.3/include/linux/memcontrol.h --- linux-4.9.76-vs2.3.9.5.2/include/linux/memcontrol.h 2018-01-24 22:26:58.000000000 +0000 +++ linux-4.9.76-vs2.3.9.5.3/include/linux/memcontrol.h 2018-01-25 00:07:15.000000000 +0000 @@ -407,6 +407,7 @@ extern unsigned long mem_cgroup_mem_usag extern unsigned long mem_cgroup_mem_limit_pages(struct mem_cgroup *memcg); extern unsigned long mem_cgroup_memsw_usage_pages(struct mem_cgroup *memcg); extern unsigned long mem_cgroup_memsw_limit_pages(struct mem_cgroup *memcg); +extern void dump_mem_cgroup(struct mem_cgroup *memcg); static inline bool mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *memcg) diff -NurpP --minimal linux-4.9.76-vs2.3.9.5.2/kernel/vserver/limit.c linux-4.9.76-vs2.3.9.5.3/kernel/vserver/limit.c --- linux-4.9.76-vs2.3.9.5.2/kernel/vserver/limit.c 2018-01-24 23:45:57.000000000 +0000 +++ linux-4.9.76-vs2.3.9.5.3/kernel/vserver/limit.c 2018-01-25 00:07:15.000000000 +0000 @@ -256,15 +256,42 @@ int vc_rlimit_stat(struct vx_info *vxi, #ifdef CONFIG_MEMCG + +void dump_sysinfo(struct sysinfo *si) +{ + printk(KERN_INFO "sysinfo: memunit=%u\n" + "\ttotalram:\t%lu\n" + "\tfreeram:\t%lu\n" + "\tsharedram:\t%lu\n" + "\tbufferram:\t%lu\n" + "\ttotalswap:\t%lu\n" + "\tfreeswap:\t%lu\n" + "\ttotalhigh:\t%lu\n" + "\tfreehigh:\t%lu\n", + si->mem_unit, + si->totalram, + si->freeram, + si->sharedram, + si->bufferram, + si->totalswap, + si->freeswap, + si->totalhigh, + si->freehigh); +} + void vx_vsi_meminfo(struct sysinfo *val) { struct mem_cgroup *mcg; unsigned long res_limit, res_usage; unsigned shift; + if (VXD_CBIT(cvirt, 4)) + dump_sysinfo(val); rcu_read_lock(); mcg = mem_cgroup_from_task(current); + if (VXD_CBIT(cvirt, 5)) + dump_mem_cgroup(mcg); rcu_read_unlock(); if (!mcg) goto out; @@ -291,8 +318,13 @@ void vx_vsi_swapinfo(struct sysinfo *val signed long swap_limit, swap_usage; unsigned shift; + if (VXD_CBIT(cvirt, 6)) + dump_sysinfo(val); + rcu_read_lock(); mcg = mem_cgroup_from_task(current); + if (VXD_CBIT(cvirt, 7)) + dump_mem_cgroup(mcg); rcu_read_unlock(); if (!mcg) goto out; @@ -334,8 +366,13 @@ long vx_vsi_cached(struct sysinfo *val) #ifdef CONFIG_MEMCG_BROKEN struct mem_cgroup *mcg; + if (VXD_CBIT(cvirt, 8)) + dump_sysinfo(val); + rcu_read_lock(); mcg = mem_cgroup_from_task(current); + if (VXD_CBIT(cvirt, 9)) + dump_mem_cgroup(mcg); rcu_read_unlock(); if (!mcg) goto out; diff -NurpP --minimal linux-4.9.76-vs2.3.9.5.2/mm/memcontrol.c linux-4.9.76-vs2.3.9.5.3/mm/memcontrol.c --- linux-4.9.76-vs2.3.9.5.2/mm/memcontrol.c 2018-01-24 23:33:09.000000000 +0000 +++ linux-4.9.76-vs2.3.9.5.3/mm/memcontrol.c 2018-01-25 00:07:42.000000000 +0000 @@ -2845,6 +2845,21 @@ unsigned long mem_cgroup_memsw_limit_pag return memcg->memsw.limit; } +void dump_mem_cgroup(struct mem_cgroup *memcg) +{ + printk(KERN_INFO "memcg: %p/%d:\n" + "\tmemory:\t%lu/%lu %lu/%lu\n" + "\tmemsw:\t%lu/%lu %lu/%lu\n" + "\tkmem:\t%lu/%lu %lu/%lu\n", + memcg, memcg->id.id, + page_counter_read(&memcg->memory), memcg->memory.limit, + memcg->memory.watermark, memcg->memory.failcnt, + page_counter_read(&memcg->memsw), memcg->memsw.limit, + memcg->memsw.watermark, memcg->memsw.failcnt, + page_counter_read(&memcg->kmem), memcg->kmem.limit, + memcg->kmem.watermark, memcg->kmem.failcnt); +} + #ifndef CONFIG_SLOB static int memcg_online_kmem(struct mem_cgroup *memcg) {