Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754811AbbB0RNL (ORCPT ); Fri, 27 Feb 2015 12:13:11 -0500 Received: from mail-ob0-f170.google.com ([209.85.214.170]:48203 "EHLO mail-ob0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753860AbbB0RNH (ORCPT ); Fri, 27 Feb 2015 12:13:07 -0500 MIME-Version: 1.0 In-Reply-To: <54F09E62.8000007@gmail.com> References: <1424660891-12719-1-git-send-email-cyphar@cyphar.com> <20150227114940.GB3964@htj.duckdns.org> <54F09E62.8000007@gmail.com> From: Tim Hockin Date: Fri, 27 Feb 2015 09:12:45 -0800 Message-ID: Subject: Re: [PATCH RFC 0/2] add nproc cgroup subsystem To: Austin S Hemmelgarn Cc: Tejun Heo , Aleksa Sarai , lizefan@huawei.com, mingo@redhat.com, peterz@infradead.org, richard@nod.at, =?ISO-8859-1?Q?Fr=E9d=E9ric_Weisbecker?= , Linux Kernel Mailing List , cgroups@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2847 Lines: 62 On Fri, Feb 27, 2015 at 8:42 AM, Austin S Hemmelgarn wrote: > On 2015-02-27 06:49, Tejun Heo wrote: >> >> Hello, >> >> On Mon, Feb 23, 2015 at 02:08:09PM +1100, Aleksa Sarai wrote: >>> >>> 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). >> >> >> This isn't a proper resource to control. kmemcg just grew proper >> reclaim support and will be useable to control kernel side of memory >> consumption. I was told that the plan was to use kmemcg - but I was told that YEARS AGO. In the mean time we all either do our own thing or we do nothing and suffer. Something like this is long overdue, IMO, and is still more appropriate and obvious than kmemcg anyway. >> Thanks. >> > 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. > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/