[Devel] [PATCH RHEL8 COMMIT] memcg: Enable accounting for pids in nested pid namespaces
Konstantin Khorenko
khorenko at virtuozzo.com
Tue Apr 20 19:35:00 MSK 2021
The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.18
------>
commit 545f6bbc97c707c5f8055398e025eb022873803f
Author: Vasily Averin <vvs at virtuozzo.com>
Date: Tue Apr 20 19:35:00 2021 +0300
memcg: Enable accounting for pids in nested pid namespaces
init_pid_ns.pid_cachep have enabled memcg accounting, though this
setting was disabled for nested pid namespaces.
https://jira.sw.ru/browse/PSBM-120694
Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
kernel/pid_namespace.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
index 2529acfd5891..a25046a55dbd 100644
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -53,7 +53,8 @@ static struct kmem_cache *create_pid_cachep(unsigned int level)
mutex_lock(&pid_caches_mutex);
/* Name collision forces to do allocation under mutex. */
if (!*pkc)
- *pkc = kmem_cache_create(name, len, 0, SLAB_HWCACHE_ALIGN, 0);
+ *pkc = kmem_cache_create(name, len, 0,
+ SLAB_HWCACHE_ALIGN | SLAB_ACCOUNT, 0);
mutex_unlock(&pid_caches_mutex);
/* current can fail, but someone else can succeed. */
return READ_ONCE(*pkc);
More information about the Devel
mailing list