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

Submitted by Konstantin Khorenko on Feb. 21, 2019, 9:23 a.m.

Details

Message ID 201902210923.x1L9NgnI022803@finist-ce7.sw.ru
State New
Series "ub/mm: fix reporting kmemsize failcounters in /proc/user_beancounters"
Headers show

Commit Message

Konstantin Khorenko Feb. 21, 2019, 9:23 a.m.
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@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@virtuozzo.com>
---
 mm/memcontrol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

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);