[Devel] [PATCH RHEL7 COMMIT] ub/mm: fix reporting kmemsize failcounters in /proc/user_beancounters

Konstantin Khorenko khorenko at virtuozzo.com
Thu Feb 21 12:23:44 MSK 2019


The commit is pushed to "branch-rh7-3.10.0-957.1.3.vz7.83.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.1.3.vz7.83.14
------>
commit b4ee899abc7e810438ff704cbf2f0d745865588c
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Thu Feb 21 12:19:18 2019 +0300

    ub/mm: fix reporting kmemsize failcounters in /proc/user_beancounters
    
    kmemsize values are synced from memcg to ub and multiplied by
    pagesize as kmemsize values are reported in bytes.
    
    But kmemsize failcounters should not be multiplied.
    
    Fixes: 7d89113ed756 ("mm/memcontrol: res_counter -> page_counter
    transition")
    https://jira.sw.ru/browse/PSBM-91915
    
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 mm/memcontrol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 61b15e311afc..1562b429f45e 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5022,7 +5022,7 @@ void mem_cgroup_sync_beancounter(struct mem_cgroup *memcg,
 	//todo: check odd code - counting in bytes instead of pages. wtf???
 	k->held = page_counter_read(&memcg->kmem) << PAGE_SHIFT;
 	k->maxheld = memcg->kmem.watermark << PAGE_SHIFT;
-	k->failcnt = memcg->kmem.failcnt << PAGE_SHIFT;
+	k->failcnt = memcg->kmem.failcnt;
 	lim = memcg->kmem.limit << PAGE_SHIFT;
 	lim = lim >= (PAGE_COUNTER_MAX << PAGE_SHIFT) ? UB_MAXVALUE :
 		min_t(unsigned long long, lim, UB_MAXVALUE);



More information about the Devel mailing list