[RHEL8,COMMIT] memcg: enable memory accounting for flctx_cache

Submitted by Konstantin Khorenko on Sept. 30, 2020, 2:25 p.m.

Details

Message ID 202009301425.08UEPbBI067499@finist-co8.sw.ru
State New
Series "memcg: enable memory accounting for flctx_cache"
Headers show

Commit Message

Konstantin Khorenko Sept. 30, 2020, 2:25 p.m.
The commit is pushed to "branch-rh8-4.18.0-193.6.3.vz8.4.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-193.6.3.vz8.4.9
------>
commit 3389f803126536d8a84c6ea667f56ad63a49e59a
Author: Vasily Averin <vvs@virtuozzo.com>
Date:   Wed Sep 30 17:25:37 2020 +0300

    memcg: enable memory accounting for flctx_cache
    
    New kernels allocate flctx_cache entries for each locked inode.
    If we account memory used for filelock_cache entries it makes sense
    to account flctx_cache entries too.
    
    https://jira.sw.ru/browse/PSBM-120694
    
    Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 fs/locks.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/fs/locks.c b/fs/locks.c
index 7fd8fc5afc47..0049244a2732 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -2801,7 +2801,8 @@  static int __init filelock_init(void)
 	int i;
 
 	flctx_cache = kmem_cache_create("file_lock_ctx",
-			sizeof(struct file_lock_context), 0, SLAB_PANIC, NULL);
+					 sizeof(struct file_lock_context), 0,
+					 SLAB_PANIC | SLAB_ACCOUNT, NULL);
 
 	filelock_cache = kmem_cache_create("file_lock_cache",
 			sizeof(struct file_lock), 0, SLAB_PANIC | SLAB_ACCOUNT, NULL);