The commit is pushed to "branch-rh9-5.14.vz9.1.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after ark-5.14 ------> commit 6433903745bda56a15fc711dc0d8961122467f3d Author: Vasily Averin <v...@virtuozzo.com> Date: Tue Sep 28 14:16:21 2021 +0300
ms/memcg: enable accounting for file lock caches User can create file locks for each open file and force kernel to allocate small but long-living objects per each open file. It makes sense to account for these objects to limit the host's memory consumption from inside the memcg-limited container. Link: https://lkml.kernel.org/r/b009f4c7-f0ab-c0ec-8e83-918f47d67...@virtuozzo.com Signed-off-by: Vasily Averin <v...@virtuozzo.com> Reviewed-by: Shakeel Butt <shake...@google.com> Cc: Alexander Viro <v...@zeniv.linux.org.uk> Cc: Alexey Dobriyan <adobri...@gmail.com> Cc: Andrei Vagin <ava...@gmail.com> Cc: Borislav Petkov <b...@alien8.de> Cc: Borislav Petkov <b...@suse.de> Cc: Christian Brauner <christian.brau...@ubuntu.com> Cc: Dmitry Safonov <0x7f454...@gmail.com> Cc: "Eric W. Biederman" <ebied...@xmission.com> Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org> Cc: "H. Peter Anvin" <h...@zytor.com> Cc: Ingo Molnar <mi...@redhat.com> Cc: "J. Bruce Fields" <bfie...@fieldses.org> Cc: Jeff Layton <jlay...@kernel.org> Cc: Jens Axboe <ax...@kernel.dk> Cc: Jiri Slaby <jirisl...@kernel.org> Cc: Johannes Weiner <han...@cmpxchg.org> Cc: Kirill Tkhai <ktk...@virtuozzo.com> Cc: Michal Hocko <mho...@kernel.org> Cc: Oleg Nesterov <o...@redhat.com> Cc: Roman Gushchin <g...@fb.com> Cc: Serge Hallyn <se...@hallyn.com> Cc: Tejun Heo <t...@kernel.org> Cc: Thomas Gleixner <t...@linutronix.de> Cc: Vladimir Davydov <vdavydov....@gmail.com> Cc: Yutian Yang <ngla...@gmail.com> Cc: Zefan Li <lizefa...@bytedance.com> Signed-off-by: Andrew Morton <a...@linux-foundation.org> Signed-off-by: Linus Torvalds <torva...@linux-foundation.org> (cherry picked from commit 0f12156dff2862ac54235fc72703f18770769042) https://jira.sw.ru/browse/PSBM-133990 Signed-off-by: Vasily Averin <v...@virtuozzo.com> --- fs/locks.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 3edcf30793d5..b091aed32437 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -3056,10 +3056,12 @@ 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, NULL); + sizeof(struct file_lock), 0, + SLAB_PANIC | SLAB_ACCOUNT, NULL); for_each_possible_cpu(i) { struct file_lock_list_struct *fll = per_cpu_ptr(&file_lock_list, i); _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel