[RH8] memcg: enable memory accounting for flctx_cache

Submitted by Vasily Averin on Sept. 29, 2020, 7:10 a.m.

Details

Message ID 96586178-51b7-5cf7-b982-79f871201a9a@virtuozzo.com
State New
Series "memcg: enable memory accounting for flctx_cache"
Headers show

Commit Message

Vasily Averin Sept. 29, 2020, 7:10 a.m.
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@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);