[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150227170640.GK3964@htj.duckdns.org>
Date: Fri, 27 Feb 2015 12:06:40 -0500
From: Tejun Heo <tj@...nel.org>
To: Austin S Hemmelgarn <ahferroin7@...il.com>
Cc: Aleksa Sarai <cyphar@...har.com>, lizefan@...wei.com,
mingo@...hat.com, peterz@...radead.org, richard@....at,
fweisbec@...il.com, linux-kernel@...r.kernel.org,
cgroups@...r.kernel.org
Subject: Re: [PATCH RFC 0/2] add nproc cgroup subsystem
Hello,
On Fri, Feb 27, 2015 at 11:42:10AM -0500, Austin S Hemmelgarn wrote:
> Kernel memory consumption isn't the only valid reason to want to limit the
> number of processes in a cgroup. Limiting the number of processes is very
> useful to ensure that a program is working correctly (for example, the NTP
> daemon should (usually) have an _exact_ number of children if it is
> functioning correctly, and rpcbind shouldn't (AFAIK) ever have _any_
> children), to prevent PID number exhaustion, to head off DoS attacks against
> forking network servers before they get to the point of causing kmem
> exhaustion, and to limit the number of processes in a cgroup that uses lots
> of kernel memory very infrequently.
All the use cases you're listing are extremely niche and can be
trivially achieved without introducing another cgroup controller. Not
only that, they're actually pretty silly. Let's say NTP daemon is
misbehaving (or its code changed w/o you knowing or there are corner
cases which trigger extremely infrequently). What do you exactly
achieve by rejecting its fork call? It's just adding another
variation to the misbehavior. It was misbehaving before and would now
be continuing to misbehave after a failed fork.
In general, I'm pretty strongly against adding controllers for things
which aren't fundamental resources in the system. What's next? Open
files? Pipe buffer? Number of flocks? Number of session leaders or
program groups?
If you want to prevent a certain class of jobs from exhausting a given
resource, protecting that resource is the obvious thing to do.
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists