From: Li Zefan <lizf-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
To: Paul Menage <menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: [PATCH 4/7] [RFC] Allow cgroup hierarchies to be created with no bound subsystems
Date: Wed, 01 Apr 2009 14:40:04 +0800 [thread overview]
Message-ID: <49D30C44.8050802@cn.fujitsu.com> (raw)
In-Reply-To: <6599ad830903310145l7b24ad0vb4462f94390ac264-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Paul Menage wrote:
> On Mon, Mar 16, 2009 at 11:45 PM, Li Zefan <lizf-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org> wrote:
>>> +static void init_root_id(struct cgroupfs_root *root)
>>> +{
>>> + BUG_ON(!ida_pre_get(&hierarchy_ida, GFP_KERNEL));
>> we should return -errno, BUG_ON() on this is wrong
>
> Hmm. Fair enough in the new root case, since it's possible we'd not
> get the memory then - I've changed init_root_id() to return false on
> failure. But I think that in cgroup_init(), we need to
> BUG_ON(!init_root_id()) - we shouldn't be able to fail that early in
> boot and there's no sensible way to handle it if it happens.
>
agreed
>>> + spin_lock(&hierarchy_id_lock);
>>> + if (ida_get_new_above(&hierarchy_ida, next_hierarchy_id,
>>> + &root->hierarchy_id)) {
>>> + BUG_ON(ida_get_new(&hierarchy_ida, &root->hierarchy_id));
>>> + }
>> next_hierarchy_id is redundant, just use ida_get_new() instead of
>> ida_get_new_above()
>
>>From the idr.c code it looks as though ida_get_new() always returns
> the smallest unused ID. I want to cycle through increasing IDs until
> we hit the end of the range, and then start again at 0.
>
Makes sense, but it would be better to add a comment.
>> and I think we should check EAGAIN:
>
> OK, I've changed this to handle EAGAIN. I don't see any value in
> handling ENOSPC though - we're not going to fill up a 31-bit IDR.
>
>>> - if (!opts->subsys_bits)
>>> + if (!opts->subsys_bits && !opts->none)
>>> return ERR_PTR(-EINVAL);
>>>
>> Shouldn't we check this in parse_cgroupfs_options() instead?
>
> No, becase at that point it's valid - we can request the root named X
> without specifying what subsystems X is already mounted with. But if
> we don't find a root named X, then we're creating a new root, and we
> have to have specified a set of subsystems, or else explicitly "none".
>
I see your poing. Again, better to have a comment in the code.
>> and what's the concern to not print out all the tasks? the buffer
>> limit of seqfile?
>
> Yes.
>
Hmm, I just had a try, and I found we don't need to worry about this,
seqfile can handle output that larger than PAGE_SIZE well.
next prev parent reply other threads:[~2009-04-01 6:40 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-12 10:51 [PATCH 0/7][RFC] CGroup hierarchy extensions Paul Menage
[not found] ` <20090312104507.24154.71691.stgit-B63HFAS8fGlSzHKm+aFRNNkmqwFzkYv6@public.gmane.org>
2009-03-12 10:51 ` [PATCH 1/7] [RFC] Support named cgroups hierarchies Paul Menage
[not found] ` <20090312105122.24154.73633.stgit-B63HFAS8fGlSzHKm+aFRNNkmqwFzkYv6@public.gmane.org>
2009-03-17 6:44 ` Li Zefan
[not found] ` <49BF46BC.4080302-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2009-03-31 8:12 ` Paul Menage
[not found] ` <6599ad830903310112x626252c4je760a80eb1eaa1d-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-04-01 6:24 ` Li Zefan
2009-03-12 10:51 ` [PATCH 2/7] [RFC]Move the cgroup debug subsys into cgroup.c to access internal state Paul Menage
[not found] ` <20090312105127.24154.39200.stgit-B63HFAS8fGlSzHKm+aFRNNkmqwFzkYv6@public.gmane.org>
2009-03-17 6:44 ` Li Zefan
2009-03-12 10:51 ` [PATCH 3/7] [RFC] Add a back-pointer from struct cg_cgroup_link to struct cgroup Paul Menage
[not found] ` <20090312105132.24154.99250.stgit-B63HFAS8fGlSzHKm+aFRNNkmqwFzkYv6@public.gmane.org>
2009-03-17 6:44 ` Li Zefan
2009-03-12 10:51 ` [PATCH 4/7] [RFC] Allow cgroup hierarchies to be created with no bound subsystems Paul Menage
[not found] ` <20090312105137.24154.34890.stgit-B63HFAS8fGlSzHKm+aFRNNkmqwFzkYv6@public.gmane.org>
2009-03-17 6:45 ` Li Zefan
[not found] ` <49BF470D.8080600-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2009-03-31 8:45 ` Paul Menage
[not found] ` <6599ad830903310145l7b24ad0vb4462f94390ac264-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-04-01 6:40 ` Li Zefan [this message]
[not found] ` <49D30C44.8050802-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2009-04-02 8:17 ` Paul Menage
2009-03-12 10:51 ` [PATCH 5/7] [RFC] Remove cgroup_subsys.root pointer Paul Menage
2009-03-12 10:51 ` [PATCH 6/7] [RFC] Support multiply-bindable cgroup subsystems Paul Menage
[not found] ` <20090312105147.24154.62638.stgit-B63HFAS8fGlSzHKm+aFRNNkmqwFzkYv6@public.gmane.org>
2009-03-17 6:46 ` Li Zefan
[not found] ` <49BF4744.5060309-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2009-03-18 2:09 ` Li Zefan
[not found] ` <49C057EB.1000307-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2009-03-18 2:16 ` Paul Menage
[not found] ` <6599ad830903171916x7364ec7cw76975d71d5125d82-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-03-18 2:39 ` Li Zefan
[not found] ` <49C05EDF.5010607-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2009-03-18 2:43 ` Paul Menage
[not found] ` <6599ad830903171943x7884cb03w8f22fa1629d667b3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-03-18 3:09 ` Li Zefan
[not found] ` <49C065E7.8060901-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2009-03-18 5:43 ` Balbir Singh
2009-03-31 9:02 ` Paul Menage
[not found] ` <6599ad830903310202p1c268237lff283b2676f78864-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-04-01 6:44 ` Li Zefan
2009-03-12 10:51 ` [PATCH 7/7] [RFC] Example multi-bindable subsystem: a per-cgroup notes field Paul Menage
[not found] ` <20090312105153.24154.29389.stgit-B63HFAS8fGlSzHKm+aFRNNkmqwFzkYv6@public.gmane.org>
2009-03-17 6:46 ` Li Zefan
2009-03-16 1:10 ` [PATCH 0/7][RFC] CGroup hierarchy extensions KAMEZAWA Hiroyuki
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=49D30C44.8050802@cn.fujitsu.com \
--to=lizf-bthxqxjhjhxqfuhtdcdx3a@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.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