linux-stable/ipc
Vasily Averin 3e0c1ab197 ipc: remove memcg accounting for sops objects in do_semtimedop()
commit 6a4746ba06 upstream.

Linus proposes to revert an accounting for sops objects in
do_semtimedop() because it's really just a temporary buffer
for a single semtimedop() system call.

This object can consume up to 2 pages, syscall is sleeping
one, size and duration can be controlled by user, and this
allocation can be repeated by many thread at the same time.

However Shakeel Butt pointed that there are much more popular
objects with the same life time and similar memory
consumption, the accounting of which was decided to be
rejected for performance reasons.

Considering at least 2 pages for task_struct and 2 pages for
the kernel stack, a back of the envelope calculation gives a
footprint amplification of <1.5 so this temporal buffer can be
safely ignored.

The factor would IMO be interesting if it was >> 2 (from the
PoV of excessive (ab)use, fine-grained accounting seems to be
currently unfeasible due to performance impact).

Link: https://lore.kernel.org/lkml/90e254df-0dfe-f080-011e-b7c53ee7fd20@virtuozzo.com/
Fixes: 18319498fd ("memcg: enable accounting of ipc resources")
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: Michal Koutný <mkoutny@suse.com>
Acked-by: Shakeel Butt <shakeelb@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-11-10 17:57:58 +01:00
..
compat.c
ipc_sysctl.c proc/sysctl: add shared variables for range check 2019-07-18 17:08:07 -07:00
Makefile
mq_sysctl.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
mqueue.c ipc/mqueue: use get_tree_nodev() in mqueue_get_tree() 2022-06-14 18:11:41 +02:00
msg.c memcg: enable accounting of ipc resources 2022-11-10 17:57:54 +01:00
msgutil.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 52 2019-05-24 17:36:42 +02:00
namespace.c ipc: Convert mqueue fs to fs_context 2019-02-28 03:29:29 -05:00
sem.c ipc: remove memcg accounting for sops objects in do_semtimedop() 2022-11-10 17:57:58 +01:00
shm.c memcg: enable accounting of ipc resources 2022-11-10 17:57:54 +01:00
syscall.c ipc: rename old-style shmctl/semctl/msgctl syscalls 2019-01-25 17:22:50 +01:00
util.c ipc: WARN if trying to remove ipc object which is absent 2021-11-26 10:47:21 +01:00
util.h ipc: fix sparc64 ipc() wrapper 2019-09-07 21:42:25 +02:00