public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Glauber Costa <glommer@parallels.com>
To: Max Kellermann <mk@cm4all.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
	Tim Hockin <thockin@hockin.org>,
	<containers@lists.linux-foundation.org>,
	<linux-kernel@vger.kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] new cgroup controller "fork"
Date: Thu, 3 Nov 2011 16:34:57 -0200	[thread overview]
Message-ID: <4EB2DED1.3060602@parallels.com> (raw)
In-Reply-To: <20111103183018.GA28318@rabbit.intern.cm-ag>

On 11/03/2011 04:30 PM, Max Kellermann wrote:
> On 2011/11/03 18:50, Glauber Costa<glommer@parallels.com>  wrote:
>> That still seems to be up to admin. If no processes are removed from
>> the cgroup or included in the cgroup, the only action/verb the
>> counter
>> is concerned about is to fork. Under this circumstance, both seem
>> equivalent from my PoV.
>
> I'm confused.  One of us misunderstands the whole thing.
>
> Examples of both controllers:
>
> task_counter: task.limit=2.  Let's say the only process in that group
> forks, then you have two processes.  Forking is disallowed from now
> on.  The child process exits, and there's only one left - which is
> allowed to fork!  The group may bounce between 0 and 2 processes
> forever.

Ah, I see. I assumed you were decrementing the counter when a process 
exited.

> cgroup_fork: fork.remaining=2.  Now let's say we have one thousand
> processes in that group!  One of those forks (allowed).  And it forks
> again (allowed).  And tries again - blocked because "fork.remaining"
> has reached zero.  We have 1002 processes; when 1001 of those
> processes exit, one remains, but it is still disallowed to fork,
> because "fork.remaining" is still zero.  It will remaing zero until
> somebody with write permissions raises it again.
>
> Did I get it wrong?  To me, that is not look equivalent at all.
No, I was not careful enough when reading the patch, and as already 
stated, I made an assumption that seemed reasonable.

Which raises the question: If you don't decrement on exit, and only 
count how many forks happened in the past, what is your use case for this?

Please note that both of you seem to target the same goal: prevent fork 
bombs. If a child exits, I see no reason to not open up room for a new 
process inside the group.

  reply	other threads:[~2011-11-03 18:35 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 [this message]
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
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=4EB2DED1.3060602@parallels.com \
    --to=glommer@parallels.com \
    --cc=akpm@linux-foundation.org \
    --cc=containers@lists.linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mk@cm4all.com \
    --cc=thockin@hockin.org \
    /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