Skip to content

RFC Resource controllers based on process containers

Pavel Emelianov lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest7 patches 121 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7Resource countersinclude/linux/res_counter.h init/Kconfig kernel/Makefile +1 more+160 -015 replies
2/7RSS controller coreinclude/linux/rss_container.h init/Kconfig mm/Makefile +1 more+384 -065 replies
3/7Data structures changes for RSS accountinginclude/linux/mm.h include/linux/mm_types.h include/linux/sched.h +2 more+35 -77 replies
4/7RSS accounting hooks over the codefs/exec.c include/linux/rmap.h mm/fremap.c +4 more+120 -2823 replies
5/7Per-container OOM killer and page reclamationmm/oom_kill.c mm/vmscan.c+228 -42 replies
6/7Account for the number of tasks within containerinclude/linux/numproc_container.h include/linux/sched.h init/Kconfig +5 more+204 -04 replies
7/7Account for the number of files opened within containerfs/Makefile fs/file_table.c fs/numfiles_container.c +4 more+208 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC][PATCH 0/7] Resource controllers based on process containers

This patchset adds RSS, accounting and control and limiting the number of tasks and files within container.

Based on top of Paul Menage's container subsystem v7

RSS controller includes per-container RSS accounter, reclamation and OOM killer. It behaves like standalone machine - when container runs out of resources it tries to reclaim some pages and if it doesn't succeed in it kills some task which mm_struct belongs to container in question.

Num tasks and files containers are very simple and self-descriptive from code.

As discussed before when a task moves from one container to another no resources follow it - they keep holding the container they were allocated in.

The difficulties met during using of Pauls' containers were:

1. Container fork hook is placed before new task changes. This makes impossible of handling fork properly. I.e. new mm_struct should have pointer to RSS container, but we don't have one at that early time.

2. Extended containers may register themselves too late. Kernel threads/helpers start forking, opening files and touching pages much earlier. This patchset workarounds this in not-so-cute manner and I'm waiting for Paul's comments on this issue.