[Devel,RHEL7,COMMIT] mm/memcg: make __memcg_activate_kmem() to actually activate kmem

Submitted by Konstantin Khorenko on March 31, 2017, 3:13 p.m.

Details

Message ID 201703311513.v2VFDIgN001638@finist_cl7.x64_64.work.ct
State New
Series "Series without cover letter"
Headers show

Commit Message

Konstantin Khorenko March 31, 2017, 3:13 p.m.
The commit is pushed to "branch-rh7-3.10.0-514.10.2.vz7.29.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-514.10.2.vz7.29.9
------>
commit 1595ecf7283ab8d77add764803f9403a76189a87
Author: Andrey Ryabinin <aryabinin@virtuozzo.com>
Date:   Fri Mar 31 19:13:17 2017 +0400

    mm/memcg: make __memcg_activate_kmem() to actually activate kmem
    
    Commit 5e049077fce3 ("ms/memcg: rework memcg_update_kmem_limit synchronization")
    which is actually reapplied after rebase commit d0abbfb74b16
    forget to set active bit on kmem_account_flags.
    This leaves kmem accounting disabled.
    
    Fix that by calling memcg_kmem_set_active(memcg) from __memcg_activate_kmem();
    
    https://jira.sw.ru/browse/PSBM-62827
    
    Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 mm/memcontrol.c | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 13d4205..bc72a26 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4351,6 +4351,8 @@  static int __memcg_activate_kmem(struct mem_cgroup *memcg,
 	 * patched.
 	 */
 	memcg->kmemcg_id = memcg_id;
+	set_bit(KMEM_ACCOUNTED_ACTIVE, &memcg->kmem_account_flags);
+	set_bit(KMEM_ACCOUNTED_ACTIVATED, &memcg->kmem_account_flags);
 out:
 	return err;
 }