[Devel] [PATCH RH8] memcg: enable memory accounting for flctx_cache

Vasily Averin vvs at virtuozzo.com
Tue Sep 29 10:10:31 MSK 2020


New kernels allocates 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 at virtuozzo.com>
---
 fs/locks.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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



More information about the Devel mailing list