From: Frederic Weisbecker <fweisbec@gmail.com>
To: Paul Menage <menage@google.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Li Zefan <lizf@cn.fujitsu.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [RFC PATCH 4/4] cgroups: Add an rlimit subsystem
Date: Thu, 23 Jun 2011 15:48:04 +0200 [thread overview]
Message-ID: <20110623134759.GC8058@somewhere.redhat.com> (raw)
In-Reply-To: <BANLkTin_MA+Yc7=q=cK5s2CbCfu_xmqTAQ@mail.gmail.com>
On Tue, Jun 21, 2011 at 10:37:03AM -0700, Paul Menage wrote:
> On Sun, Jun 19, 2011 at 4:51 PM, Frederic Weisbecker <fweisbec@gmail.com> wrote:
> > +static void rlim_cgroup_exit(struct cgroup_subsys *ss, struct cgroup *cgrp,
> > + struct cgroup *old_cgrp, struct task_struct *task)
> > +{
> > + rlim_remove_proc(old_cgrp);
> > +}
>
> Since this is used for both the exit callback and the attach callback,
> it should have a more generic name.
Right.
> > +static int rlim_can_attach_task(struct cgroup *cgrp, struct task_struct *tsk)
> > +{
> > + struct rlim *rlim = cgroup_rlim(cgrp);
> > + struct res_counter *limit_fail_at;
> > +
> > + return res_counter_charge(&rlim->proc_counter, 1, &limit_fail_at);
> > +}
>
> Can't this fail spuriously in the presence of hierarchies?
>
> E.g. if cgroup A has children, and A is at its limit, then moving
> tasks around between A and its children, or between different children
> of A, seems like it would fail due to the temporary double counting.
Good point. Probably I should first uncharge the old cgroup and its parents.
next prev parent reply other threads:[~2011-06-23 13:48 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-19 23:51 [RFC PATCH 0/4] cgroups: Start a basic rlimit subsystem Frederic Weisbecker
2011-06-19 23:51 ` [RFC PATCH 1/4] cgroups: Allow a cgroup subsys to reject a fork Frederic Weisbecker
2011-06-21 17:39 ` Paul Menage
2011-06-23 13:38 ` Frederic Weisbecker
2011-06-19 23:51 ` [RFC PATCH 2/4] cgroups: Add res_counter_write_u64() API Frederic Weisbecker
2011-06-19 23:51 ` [RFC PATCH 3/4] cgroups: New resource counter inheritance API Frederic Weisbecker
2011-06-19 23:51 ` [RFC PATCH 4/4] cgroups: Add an rlimit subsystem Frederic Weisbecker
2011-06-21 17:37 ` Paul Menage
2011-06-23 13:48 ` Frederic Weisbecker [this message]
2011-06-24 22:22 ` Paul Menage
2011-06-28 17:37 ` Aditya Kali
2011-07-06 0:21 ` Frederic Weisbecker
2011-06-28 18:08 ` Aditya Kali
2011-07-06 0:43 ` Frederic Weisbecker
2011-06-20 6:33 ` [RFC PATCH 0/4] cgroups: Start a basic " Li Zefan
2011-06-20 19:11 ` Frederic Weisbecker
2011-06-21 8:09 ` Li Zefan
2011-06-21 16:18 ` Frederic Weisbecker
2011-06-21 17:08 ` Paul Menage
2011-06-23 13:30 ` Frederic Weisbecker
2011-06-24 22:18 ` Paul Menage
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=20110623134759.GC8058@somewhere.redhat.com \
--to=fweisbec@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--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