Skip to contentSkip to conversation

memcg: accounting for fasync_cache

PATCH In review Vasily Averin 1 participant 1 message Mar 9, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 6/9 memcg: accounting for fasync_cache

Objects can be created from memcg-limited tasks
but its misuse may lead to host OOM.

---
 fs/fcntl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/fcntl.c +2 -1
index dfc72f1..7941559 100644
@@ -1049,7 +1049,8 @@ static int __init fcntl_init(void)
 			__FMODE_EXEC | __FMODE_NONOTIFY));
 
 	fasync_cache = kmem_cache_create("fasync_cache",
-		sizeof(struct fasync_struct), 0, SLAB_PANIC, NULL);
+					 sizeof(struct fasync_struct), 0,
+					 SLAB_PANIC | SLAB_ACCOUNT, NULL);
 	return 0;
 }
 
Signature · 1 line
1.8.3.1