[Devel] [PATCH RHEL8 COMMIT] memcg: enable accounting for posix_timers_cache slab
Konstantin Khorenko
khorenko at virtuozzo.com
Tue Apr 13 13:20:34 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.12
------>
commit aff375a6d9005b92abf9507b1060c51e5b0b0e33
Author: Vasily Averin <vvs at virtuozzo.com>
Date: Tue Apr 13 13:20:34 2021 +0300
memcg: enable accounting for posix_timers_cache slab
This patch enables memcg accounting for posix_timers_cache.
Unprivileged user inside container may create multiple interval
timers using timer_create() system call.
https://jira.sw.ru/browse/PSBM-120694
Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
kernel/time/posix-timers.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index 95f4446ba762..94531d2cffb5 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -318,7 +318,8 @@ static int posix_get_hrtimer_res(clockid_t which_clock, struct timespec64 *tp)
static __init int init_posix_timers(void)
{
posix_timers_cache = kmem_cache_create("posix_timers_cache",
- sizeof (struct k_itimer), 0, SLAB_PANIC,
+ sizeof (struct k_itimer), 0,
+ SLAB_PANIC | SLAB_ACCOUNT,
NULL);
return 0;
}
More information about the Devel
mailing list