All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 0/2] add nproc cgroup subsystem
@ 2015-02-23  3:08 ` Aleksa Sarai
  0 siblings, 0 replies; 108+ messages in thread
From: Aleksa Sarai @ 2015-02-23  3:08 UTC (permalink / raw)
  To: tj, lizefan, mingo, peterz
  Cc: richard, fweisbec, linux-kernel, cgroups, Aleksa Sarai

The current state of resource limitation for the number of open
processes (as well as the number of open file descriptors) requires you
to use setrlimit(2), which means that you are limited to resource
limiting process trees rather than resource limiting cgroups (which is
the point of cgroups).

There was a patch to implement this in 2011[1], but that was rejected
because it implemented a general-purpose rlimit subsystem -- which meant
that you couldn't control distinct resource limits in different
heirarchies. This patch implements a resource controller *specifically*
for the number of processes in a cgroup, overcoming this issue.

There has been a similar attempt to implement a resource controller for
the number of open file descriptors[2], which has not been merged
becasue the reasons were dubious. Merely from a "sane interface"
perspective, it should be possible to utilise cgroups to do such
rudimentary resource management (which currently only exists for process
trees).

Aleksa Sarai (2):
  cgroups: allow a cgroup subsystem to reject a fork
  cgroups: add an nproc subsystem

 include/linux/cgroup.h        |   9 ++-
 include/linux/cgroup_subsys.h |   4 +
 init/Kconfig                  |  10 +++
 kernel/Makefile               |   1 +
 kernel/cgroup.c               |  13 ++-
 kernel/cgroup_freezer.c       |   6 +-
 kernel/cgroup_nproc.c         | 181 ++++++++++++++++++++++++++++++++++++++++++
 kernel/fork.c                 |   4 +-
 kernel/sched/core.c           |   3 +-
 9 files changed, 221 insertions(+), 10 deletions(-)
 create mode 100644 kernel/cgroup_nproc.c

[1]: https://lkml.org/lkml/2011/6/19/170
[2]: https://lkml.org/lkml/2014/7/2/640

-- 
2.3.0


^ permalink raw reply	[flat|nested] 108+ messages in thread

end of thread, other threads:[~2015-03-12 15:36 UTC | newest]

Thread overview: 108+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-23  3:08 [PATCH RFC 0/2] add nproc cgroup subsystem Aleksa Sarai
2015-02-23  3:08 ` Aleksa Sarai
2015-02-23  3:08 ` [PATCH RFC 1/2] cgroups: allow a cgroup subsystem to reject a fork Aleksa Sarai
2015-02-23 14:49   ` Peter Zijlstra
2015-02-23  3:08 ` [PATCH RFC 2/2] cgroups: add an nproc subsystem Aleksa Sarai
2015-02-27  4:17 ` [RFC PATCH v2 0/2] add nproc cgroup subsystem Aleksa Sarai
2015-02-27  4:17   ` Aleksa Sarai
2015-02-27  4:17   ` [PATCH v2 1/2] cgroups: allow a cgroup subsystem to reject a fork Aleksa Sarai
2015-02-27  4:17     ` Aleksa Sarai
2015-03-09  3:06     ` Tejun Heo
2015-03-09  3:06       ` Tejun Heo
     [not found]       ` <CAOviyaip7Faz98YWzGoTaXGYVb72sfD+ZL4Xa89reU9+=43jFA@mail.gmail.com>
     [not found]         ` <20150309065902.GP13283@htj.duckdns.org>
2015-03-10  8:19           ` Aleksa Sarai
2015-03-10  8:19             ` Aleksa Sarai
2015-03-10 12:47             ` Tejun Heo
2015-03-10 12:47               ` Tejun Heo
2015-03-10 14:51               ` Aleksa Sarai
2015-03-10 14:51                 ` Aleksa Sarai
2015-03-10 15:17                 ` Tejun Heo
2015-03-10 15:17                   ` Tejun Heo
2015-03-11  5:16                   ` Aleksa Sarai
2015-03-11 11:46                     ` Tejun Heo
2015-03-11 23:47           ` Aleksa Sarai
2015-03-11 23:47             ` Aleksa Sarai
2015-03-12  1:25             ` Tejun Heo
2015-03-12  1:25               ` Tejun Heo
2015-02-27  4:17   ` [PATCH v2 2/2] cgroups: add an nproc subsystem Aleksa Sarai
2015-03-02 15:22     ` Tejun Heo
2015-03-02 15:22       ` Tejun Heo
2015-03-09  1:49       ` Zefan Li
2015-03-09  1:49         ` Zefan Li
2015-03-09  2:34         ` Tejun Heo
2015-03-09  2:34           ` Tejun Heo
2015-02-27 11:49 ` [PATCH RFC 0/2] add nproc cgroup subsystem Tejun Heo
2015-02-27 13:46   ` Richard Weinberger
2015-02-27 13:46     ` Richard Weinberger
2015-02-27 13:52     ` Tejun Heo
2015-02-27 13:52       ` Tejun Heo
2015-02-27 16:42   ` Austin S Hemmelgarn
2015-02-27 16:42     ` Austin S Hemmelgarn
2015-02-27 17:06     ` Tejun Heo
2015-02-27 17:06       ` Tejun Heo
2015-02-27 17:25       ` Tim Hockin
2015-02-27 17:25         ` Tim Hockin
2015-02-27 17:45         ` Tejun Heo
2015-02-27 17:56           ` Tejun Heo
2015-02-27 17:56             ` Tejun Heo
2015-02-27 21:45           ` Tim Hockin
2015-02-27 21:45             ` Tim Hockin
2015-02-27 21:49             ` Tejun Heo
     [not found]               ` <CAAAKZwsCc8BtFx58KMFpRTohU81oCBeGVOPGMJrjJt9q5upKfQ@mail.gmail.com>
2015-02-28 16:57                 ` Tejun Heo
2015-02-28 22:26                   ` Tim Hockin
2015-02-28 22:26                     ` Tim Hockin
2015-02-28 22:50                     ` Tejun Heo
2015-02-28 22:50                       ` Tejun Heo
2015-03-01  4:46                       ` Tim Hockin
2015-03-01  4:46                         ` Tim Hockin
2015-02-28 23:11                     ` Johannes Weiner
2015-02-28 23:11                       ` Johannes Weiner
2015-02-27 18:49       ` Austin S Hemmelgarn
2015-02-27 18:49         ` Austin S Hemmelgarn
2015-02-27 19:35         ` Tejun Heo
2015-02-27 19:35           ` Tejun Heo
2015-02-28  9:26         ` Aleksa Sarai
2015-02-28  9:26           ` Aleksa Sarai
2015-02-28 11:59           ` Tejun Heo
2015-02-28 11:59             ` Tejun Heo
     [not found]             ` <CAAAKZws45c3PhFQMGrm_K+OZV+KOyGV9sXTakHcTfNP1kHxzOQ@mail.gmail.com>
2015-02-28 16:43               ` Tejun Heo
2015-02-28 16:43                 ` Tejun Heo
2015-03-02 13:13                 ` Austin S Hemmelgarn
2015-03-02 13:31                   ` Aleksa Sarai
2015-03-02 13:31                     ` Aleksa Sarai
2015-03-02 13:54                     ` Tejun Heo
2015-03-02 13:54                       ` Tejun Heo
2015-03-02 13:49                   ` Tejun Heo
2015-02-27 17:12     ` Tim Hockin
2015-02-27 17:15       ` Tejun Heo
2015-02-27 17:15         ` Tejun Heo
2015-03-04 20:23 ` [PATCH v3 0/2] cgroup: add pids subsystem Aleksa Sarai
2015-03-04 20:23   ` [PATCH v3 1/2] cgroups: allow a cgroup subsystem to reject a fork Aleksa Sarai
2015-03-04 20:23   ` [PATCH v3 2/2] cgroups: add a pids subsystem Aleksa Sarai
2015-03-05  8:39     ` Aleksa Sarai
2015-03-05 14:37     ` Marian Marinov
2015-03-06  1:45 ` [PATCH v4 0/2] cgroup: add " Aleksa Sarai
2015-03-06  1:45   ` Aleksa Sarai
2015-03-06  1:45   ` [PATCH v4 1/2] cgroups: allow a cgroup subsystem to reject a fork Aleksa Sarai
2015-03-06  1:45   ` [PATCH v4 2/2] cgroups: add a pids subsystem Aleksa Sarai
2015-03-06  1:45     ` Aleksa Sarai
2015-03-09  3:34     ` Tejun Heo
2015-03-09  3:34       ` Tejun Heo
2015-03-09  3:39       ` Tejun Heo
2015-03-09  3:39         ` Tejun Heo
2015-03-09 18:58       ` Austin S Hemmelgarn
2015-03-09 18:58         ` Austin S Hemmelgarn
2015-03-09 19:51         ` Tejun Heo
2015-03-09 19:51           ` Tejun Heo
2015-03-10  8:10         ` Aleksa Sarai
2015-03-10  8:10           ` Aleksa Sarai
2015-03-10 11:32           ` Austin S Hemmelgarn
2015-03-10 12:31             ` Aleksa Sarai
2015-03-10 12:31               ` Aleksa Sarai
2015-03-11 15:13               ` Austin S Hemmelgarn
2015-03-11 15:13                 ` Austin S Hemmelgarn
2015-03-12  2:28                 ` Aleksa Sarai
2015-03-12  2:28                   ` Aleksa Sarai
2015-03-12 15:35                   ` Austin S Hemmelgarn
2015-03-12  3:47                 ` Tejun Heo
2015-03-09  3:08   ` [PATCH v4 0/2] cgroup: add " Tejun Heo
2015-03-09  3:08     ` Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.