From: Max Kellermann <mk@cm4all.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: menage@google.com, lizf@cn.fujitsu.com,
containers@lists.linux-foundation.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] new cgroup controller "fork"
Date: Thu, 17 Feb 2011 15:09:25 +0100 [thread overview]
Message-ID: <20110217140925.GA4115@rabbit.intern.cm-ag> (raw)
In-Reply-To: <20110217225010.7f79b412.kamezawa.hiroyu@jp.fujitsu.com>
On 2011/02/17 14:50, KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> I wonder allowing to set the limit to Root cgroup may imply the system death.
> How about disabling to set value to Root cgroup ?
That is taken care of already:
> > +static int
> > +cgroup_fork_populate(struct cgroup_subsys *ss, struct cgroup *cgroup)
> > +{
> > + if (cgroup->parent == NULL)
> > + /* cannot limit the root cgroup */
> > + return 0;
The attribute simply doesn't exist in the root cgroup.
Also watch the loop condition in cgroup_fork_pre_fork() closely, the
root cgroup isn't checked (even if you could find a way to configure
it):
> > + t = cgroup_fork_current();
> > + while (t->css.cgroup->parent != NULL && err == 0) {
> IIRC, fork()'s error code is EAGAIN or ENOMEM. The exisiting limit of
> rlimit() returns EAGAIN.
>
> How about -EAGAIN here ? I think it's not good to add new error code for
> system calls.
EPERM seemed appropriate to me, because the administrator disallows
more than N forks. If there are practical reasons for changing it to
EAGAIN or ENOMEM, I'm ok with that. Thanks for the hint.
Max
next prev parent reply other threads:[~2011-02-17 14:07 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-17 13:31 [PATCH] new cgroup controller "fork" Max Kellermann
2011-02-17 13:50 ` KAMEZAWA Hiroyuki
2011-02-17 14:09 ` Max Kellermann [this message]
2011-02-18 0:59 ` Paul Menage
2011-02-18 9:26 ` Max Kellermann
-- strict thread matches above, loose matches on Subject: below --
2011-11-03 16:22 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
2011-11-03 17:31 ` richard -rw- weinberger
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=20110217140925.GA4115@rabbit.intern.cm-ag \
--to=mk@cm4all.com \
--cc=containers@lists.linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=menage@google.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