memcg: accounting for fib6_nodes cache
Subsystems (4)
PATCH 2/9 memcg: accounting for fib6_nodes cache
Objects can be created from memcg-limited tasks
but its misuse may lead to host OOM.
--- net/ipv6/ip6_fib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/ip6_fib.c +1 -1
@@ -2445,7 +2445,7 @@ int __init fib6_init(void) fib6_node_kmem =kmem_cache_create ("fib6_nodes" ,sizeof (struct fib6_node ), -0 ,SLAB_HWCACHE_ALIGN , +0 ,SLAB_HWCACHE_ALIGN |SLAB_ACCOUNT ,NULL );if (!fib6_node_kmem) goto out;
Signature · 1 line
1.8.3.1
Quoted 14 lines · Vasily Averin
Objects can be created from memcg-limited tasks
but its misuse may lead to host OOM.Signed-off-by Vasily Averin <[email protected]>--- net/ipv6/ip6_fib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/ipv6/ip6_fib.c +0
-0
net/ipv6/ip6_fib.c int __init fib6_init(void) · line 2446
Quoted 2 lines
net/ipv6/ip6_fib.c +0
-0@@ -2445,7 +2445,7 @@ int __init fib6_init(void) fib6_node_kmem = kmem_cache_create("fib6_nodes",
Can you talk a bit more about the lifetime of the object created from this kmem cache? Also who and what operation can trigger allocation?
Similarly can you add this information to the remaining patches of your series as well?
Quoted 9 lines
net/ipv6/ip6_fib.c +1
-2sizeof (struct fib6_node ), -0 ,SLAB_HWCACHE_ALIGN , +0 ,SLAB_HWCACHE_ALIGN |SLAB_ACCOUNT , NULL);if (!fib6_node_kmem) goto out; --1.8.3.1
Quoted 16 lines · Shakeel Butt
Quoted 15 lines · Vasily Averin
Objects can be created from memcg-limited tasks
but its misuse may lead to host OOM.Signed-off-by Vasily Averin <[email protected]>--- net/ipv6/ip6_fib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/ipv6/ip6_fib.c +0
-0@@ -2445,7 +2445,7 @@ int __init fib6_init(void)
Quoted 4 lines
net/ipv6/ip6_fib.c int __init fib6_init(void) · line 2446
Quoted 1 line
net/ipv6/ip6_fib.c +0
-0fib6_node_kmem = kmem_cache_create("fib6_nodes",Can you talk a bit more about the lifetime of the object created from this kmem cache? Also who and what operation can trigger allocation?
The lifetime is less of a concern since we have a slab reparenting mechanism, unless it's a very short-living object.