Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754544AbbB0RZe (ORCPT ); Fri, 27 Feb 2015 12:25:34 -0500 Received: from mail-lb0-f174.google.com ([209.85.217.174]:40391 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752247AbbB0RZc (ORCPT ); Fri, 27 Feb 2015 12:25:32 -0500 MIME-Version: 1.0 In-Reply-To: <20150227170640.GK3964@htj.duckdns.org> References: <1424660891-12719-1-git-send-email-cyphar@cyphar.com> <20150227114940.GB3964@htj.duckdns.org> <54F09E62.8000007@gmail.com> <20150227170640.GK3964@htj.duckdns.org> From: Tim Hockin Date: Fri, 27 Feb 2015 09:25:10 -0800 X-Google-Sender-Auth: n93h7tH-bh4p6seB3cvusaoL4PM Message-ID: Subject: Re: [PATCH RFC 0/2] add nproc cgroup subsystem To: Tejun Heo Cc: Austin S Hemmelgarn , Aleksa Sarai , Li Zefan , mingo@redhat.com, Peter Zijlstra , richard@nod.at, =?UTF-8?B?RnLDqWTDqXJpYyBXZWlzYmVja2Vy?= , "linux-kernel@vger.kernel.org" , Cgroups Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3183 Lines: 66 On Fri, Feb 27, 2015 at 9:06 AM, Tejun Heo wrote: > 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? Yes to some or all of those. We do exactly this internally and it has greatly added to the stability of our overall container management system. and while you have been telling everyone to wait for kmemcg, we have had an extra 3+ years of stability. > If you want to prevent a certain class of jobs from exhausting a given > resource, protecting that resource is the obvious thing to do. I don't follow your argument - isn't this exactly what this patch set is doing - protecting resources? > Wasn't it like a year ago? Yeah, it's taking longer than everybody > hoped but seriously kmemcg reclaimer just got merged and also did the > new memcg interface which will tie kmemcg and memcg together. By my email it was almost 2 years ago, and that was the second or third incarnation of this patch. >> Something like this is long overdue, IMO, and is still more >> appropriate and obvious than kmemcg anyway. > > Thanks for chiming in again but if you aren't bringing out anything > new to the table (I don't remember you doing that last time either), > I'm not sure why the decision would be different this time. I'm just vocalizing my support for this idea in defense of practical solutions that work NOW instead of "engineering ideals" that never actually arrive. As containers take the server world by storm, stuff like this gets more and more important. Tim -- 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/