When a user send a signal to any another processes it forces the kernel to allocate memory for 'struct sigqueue' objects. The number of signals is limited by RLIMIT_SIGPENDING resource limit, but even the default settings allow each user to consume up to several megabytes of memory. It makes sense to account for these allocations to restrict the host's memory consumption from inside the memcg-limited container.
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -4663,7 +4663,7 @@ void __init signals_init(void) · 4662 unmodified lines | ||
| 4663 | 4663 | { |
| 4664 | 4664 | siginfo_buildtime_checks(); |
| 4665 | 4665 | |
| 4666 | − sigqueue_cachep = KMEM_CACHE(sigqueue, SLAB_PANIC); | |
| 4666 | + sigqueue_cachep = KMEM_CACHE(sigqueue, SLAB_PANIC | SLAB_ACCOUNT); | |
| 4667 | 4667 | } |
| 4668 | 4668 | |
| 4669 | 4669 | #ifdef CONFIG_KGDB_KDB |