public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lennart Poettering <mzxreary@0pointer.de>
To: Li Zefan <lizf@cn.fujitsu.com>
Cc: Glauber Costa <glommer@parallels.com>,
	"Brian K. White" <brian@aljex.com>,
	cgroups@vger.kernel.org, containers@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] new cgroup controller "fork"
Date: Fri, 4 Nov 2011 14:59:43 +0100	[thread overview]
Message-ID: <20111104135943.GB14377@tango.0pointer.de> (raw)
In-Reply-To: <4EB3560D.7000002@cn.fujitsu.com>

On Fri, 04.11.11 11:03, Li Zefan (lizf@cn.fujitsu.com) wrote:

> >> Sure many other processes would legitimately fork/die/fork/die a lot
> >> while never exceeding a few total concurrent tasks, and for them you
> >> would not want to set any such fork limit. So what?
> >>
> > As I said previously, he knows his use cases better than anyone else.
> > If a use case can be found in which the summation of cpu+task controllers is not enough, and if this is implemented as an option to the task controller, and does not make it:
> > 1) confusing,
> > 2) more expensive,
> > 
> > then I don't see why not we shouldn't take it.
> 
> Quoted from Lennart's reply in another mail thread:
> 
> "Given that shutting down some services might involve forking off a few
> things (think: a shell script handling shutdown which forks off a couple
> of shell utilities) we'd want something that is between "from now on no
> forking at all" and "unlimited forking". This could be done in many
> different ways: we'd be happy if we could do time-based rate limiting,
> but we'd also be fine with defining a certain budget of additional forks
> a cgroup can do (i.e. "from now on you can do 50 more forks, then you'll
> get EPERM)."
> 
> (http://lkml.org/lkml/2011/10/19/468)
> 
> The last sentence suggests he might like this fork controller.

Yes, indeed. Limiting forks like this would be pretty much exactly what
we need in systemd to make the shutdown of services robust towards
code which tries to fork faster than we could kill it. I am all in
favour of this code, especially due to its simplicity.

However, I'd like to see this implemented as part of the core cgroup
interfaces, instead of an independent controller. Otherwise we might
have multiple userspace frameworks fighting over it: LXC might want to
take posession of it, systemd too, and Max' own CGI tool might as
well. I believe limiting forks like this is an important part of the
basic cgroup management that userspace needs, independently of what a
specific software actually wants to do with it (i.e. which cgroup
controller it wants to use, if any), and it hence should be available in
all hierarchies, including the named ones that are useful to ensure that
a specific controller is not monopolized by one userspace consumer.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.

  parent reply	other threads:[~2011-11-04 13:59 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-03 16:22 [PATCH] new cgroup controller "fork" Max Kellermann
2011-11-03 16:43 ` Frederic Weisbecker
2011-11-03 17:16   ` Max Kellermann
2011-11-03 17:26     ` Glauber Costa
2011-11-03 17:48       ` Max Kellermann
2011-11-03 17:50         ` Glauber Costa
2011-11-03 18:30           ` Max Kellermann
2011-11-03 18:34             ` Glauber Costa
2011-11-03 16:43 ` Glauber Costa
2011-11-03 16:59   ` Max Kellermann
2011-11-03 17:05     ` Frederic Weisbecker
2011-11-03 18:21     ` Alan Cox
2011-11-03 18:51       ` Max Kellermann
2011-11-03 18:56         ` Glauber Costa
2011-11-03 20:08           ` Matt Helsley
2011-11-03 19:03         ` Alan Cox
2011-11-03 19:20           ` Max Kellermann
2011-11-03 19:25             ` Glauber Costa
2011-11-03 20:13               ` Brian K. White
2011-11-03 21:54                 ` Glauber Costa
2011-11-04  3:03                   ` Li Zefan
2011-11-04  4:37                     ` KAMEZAWA Hiroyuki
2011-11-04 13:11                     ` Glauber Costa
2011-11-04 13:38                       ` Max Kellermann
2011-11-04 13:59                     ` Lennart Poettering [this message]
2011-11-03 17:31 ` richard -rw- weinberger
  -- strict thread matches above, loose matches on Subject: below --
2011-02-17 13:31 Max Kellermann
2011-02-17 13:50 ` KAMEZAWA Hiroyuki
2011-02-17 14:09   ` Max Kellermann
2011-02-18  0:59 ` Paul Menage
2011-02-18  9:26   ` Max Kellermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111104135943.GB14377@tango.0pointer.de \
    --to=mzxreary@0pointer.de \
    --cc=brian@aljex.com \
    --cc=cgroups@vger.kernel.org \
    --cc=containers@lists.linux-foundation.org \
    --cc=glommer@parallels.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox