- remove 'private' field from struct subsys
- remove cgroup_init_smp()
- remove unused 'i' in cgroup_tasks_start()
Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
---
include/linux/cgroup.h |4
kernel/cgroup.c|1 -
2 files changed, 5 deletions(-)
The BUG_ON() should be protected by freezer->lock, otherwise it
can be triggered easily when a task has been unfreezed but the
corresponding cgroup hasn't been changed to FROZEN state.
Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
---
kernel/cgroup_freezer.c |3 ++-
1 fi
Don't duplicate the implementation of thaw_process().
Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
---
kernel/cgroup_freezer.c | 15 ---
1 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
index 6fadafe..3ea
Just call unfreeze_cgroup() if goal_state == THAWED, and call
try_to_freeze_cgroup() if goal_state == FROZEN.
No behavior has been changed.
Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
---
kernel/cgroup_freezer.c | 19 +++
1 files changed, 7 insertions(+), 12 deletions(-)
It is sufficient to check if @task is frozen, and no need to check if
the original freezer is frozen.
Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
---
kernel/cgroup_freezer.c | 16 +++-
1 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/kernel/cgroup_freezer.c b/
Cedric Le Goater wrote:
> Li Zefan wrote:
>> Don't duplicate the implementation of thaw_process().
>
> looks OK but you should remove __thaw_process() which is unused
> now.
>
Then I'll make it a static function and remo
Cedric Le Goater wrote:
> Li Zefan wrote:
>> It is sufficient to check if @task is frozen, and no need to check if
>> the original freezer is frozen.
>
> hmm, a task being frozen does not mean that its freezer cgroup is
> frozen.
If a task has being frozen, then can_at
90
...
Call Trace:
[] ? print_cfs_rq+0x6e/0x75d
[] ? sched_debug_show+0x72d/0xc1e
...
Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
---
kernel/cgroup.c |1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 35eebd5..358e775 100644
---
Andrew Morton wrote:
> On Thu, 30 Oct 2008 15:23:27 +0800 Li Zefan <[EMAIL PROTECTED]> wrote:
>
>> This fixes oops when reading /proc/sched_debug.
>
> In which kernel versions? The patch applies to 2.6.27 - should it be
> aplied to 2.6.27.x? Earlier?
>
I think
Paul Menage wrote:
> On Thu, Oct 30, 2008 at 12:23 AM, Li Zefan <[EMAIL PROTECTED]> wrote:
>> This fixes oops when reading /proc/sched_debug.
>>
>> A cgroup won't be removed completely until finishing cgroup_diput(), so we
>> shouldn't invalidate cgrp-&
With this change, the root cgroup is unfreezable, and writing to
its freezer.state returns -EIO.
I think it's reasonable to disallow freezing all the tasks in the
root cgroup. And this avoids fork overhead when freezer subsystem
is compiled but not used.
Signed-off-by: Li Zefan <[EMAIL P
Paul Menage wrote:
> On Mon, Aug 11, 2008 at 3:53 PM, Matt Helsley <[EMAIL PROTECTED]> wrote:
>> +}
>> +
>> +static void freezer_fork(struct cgroup_subsys *ss, struct task_struct *task)
>> +{
>> + struct freezer *freezer;
>> +
>> + task_lock(task);
>> + freezer = task_freezer(task
Paul Menage wrote:
> On Mon, Nov 3, 2008 at 11:35 PM, Li Zefan <[EMAIL PROTECTED]> wrote:
>> With this change, the root cgroup is unfreezable, and writing to
>> its freezer.state returns -EIO.
>
> EINVAL might be more consistent with other systems like cpusets.
>
task->cgroups won't be changed or invalidated.
Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
---
kernel/cgroup_freezer.c |8 ++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
index 7fa476f..6605907
Paul Menage wrote:
> On Mon, Nov 3, 2008 at 10:12 PM, Li Zefan <[EMAIL PROTECTED]> wrote:
>> I think another reasonable and easier way is to disable writing freezer.state
>> of top cgroup, so we can skip checks in freezer_fork() for tasks in top
>> cgroup.
>>
>
riting invalid value to freezer.state returns EINVAL
rather than EIO. This is more consistent with other cgroup subsystem.
Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
---
patch is based on freezer_cg-remove-task_lock-from-freezer_fork.patch
---
Documentation/cgroups/freezer-subsys
> Acked-by: Paul Menage <[EMAIL PROTECTED]>
>
> I might use the term "non-freezable" rather than "unfreezable".
>
My bad English :(
patch updated. (some annoying leading tabs are also removed in the doc)
====
From: Li Zefan <[EMAI
Li Zefan wrote:
>> Acked-by: Paul Menage <[EMAIL PROTECTED]>
>>
>> I might use the term "non-freezable" rather than "unfreezable".
>>
>
> My bad English :(
>
> patch updated. (some annoying leading tabs are also removed in the doc)
> I would make a small macro is_root_freezer() to show explicitly
> what we are testing and use the CSS_ROOT bit to test. That's what
> the CSS_ROOT bit is for Paul ?
>
I think yes CSS_ROOT can be used, though currently CSS_ROOT is used in
cgroup internal only (in css_get() and css_put()).
> if
Hi, Vivek
Thanks for your work. :)
A question below.
> +For example, assume there are two cgroups A and B with weights 1024 and 2048
> +in the system. Tasks in two cgroups A and B are doing IO to two disks sda and
> +sdb in the system. A user has enabled IO control on both sda and sdb. Now on
>
CC: Linux Containers <[EMAIL PROTECTED]>
Vivek Goyal <[EMAIL PROTECTED]>
Fabio Checconi wrote:
> Hi Jens, hi all,
>
Hi Fabio,
> this is an updated version of the patchset introducing the BFQ (Budget
> Fair Queueing) I/O scheduler. It is based on CFQ and it has been
> developed trying to
CC: KAMEZAWA Hiroyuki <[EMAIL PROTECTED]>
CC: Balbir Singh <[EMAIL PROTECTED]>
Andrew Morton wrote:
> (cc [EMAIL PROTECTED])
>
> On Thu, 13 Nov 2008 17:42:01 +0100 Jan Blunck <[EMAIL PROTECTED]> wrote:
>
>> When increasing NR_CPUS to 4096 the size of struct mem_cgroup is growing to
>> 507904 byt
good.
>
> This patch changes mem_cgroup's cpustat allocation not based
> on NR_CPUS but based on nr_cpu_ids.
>
> From: Jan Blunck <[EMAIL PROTECTED]>
> Signed-off-by: KAMEZAWA Hiroyuki <[EMAIL PROTECTED]>
>
Looks good :) . It's ok to use nr_cpu_ids when c
>>> +static int mem_cgroup_size(void)
>> inline this function?
>>
> necessary ?
>
Not so necessary IMO. It's called when a cgroup is created and removed, that
is mkdir and rmdir, where performance is not critical.
___
Containers mailing list
[EMAIL PR
Vivek Goyal wrote:
> On Fri, Nov 14, 2008 at 02:44:22PM -0800, Nauman Rafique wrote:
>> In an attempt to make sure that this discussion leads to
>> something useful, we have summarized the points raised in this
>> discussion and have come up with a strategy for future.
>> The goal of this is to fin
t. Any comments on what approach looks better?
>
Looks like a sane way :) . We are also trying to keep track of the discussion
and
development of IO controller. I'll start to have a look into BFQ.
> On Mon, Nov 17, 2008 at 6:02 PM, Li Zefan <[EMAIL PROTECTED]> wrote:
>> Vivek
h, it returns EINVAL if we try to get cgroupstats
from a normal file.
CC: Balbir Singh <[EMAIL PROTECTED]>
Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
---
kernel/cgroup.c |7 +--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
inde
> The patch applies OK to 2.6.25, 2.6.26 and to 2.6.27. I marked it as
> needing backport to those kernel versions. Please let me know if that
> was inappropriate.
>
Forgot to mention this:
The bug exists from 2.6.24 (when cgroupstats is introduced) to now, though
I didn't test in all those ve
- remove 'releasable' since it has been moved to the debug subsys.
- update lock requirements of subsys callbacks.
Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
---
Documentation/cgroups/cgroups.txt |7 ---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git
of a cgroup_fs (using
for_each_subsys), cgrp->subsys[ss->subsys_id] won't be NULL,
guaranteed by cgroup_create().
(Also remove 2 unused variables in cgroup_rmdir().
Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
---
kernel/cgroup.c | 31 ---
1 files
I happened to find the spinlock in struct ns_cgroup is never
used.
Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
---
kernel/ns_cgroup.c |2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/kernel/ns_cgroup.c b/kernel/ns_cgroup.c
index 43c2111..78bc3fd 100644
--- a/
s/contoller/controller
Signed-of-by: Li Zefan <[EMAIL PROTECTED]>
---
init/Kconfig |2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/init/Kconfig b/init/Kconfig
index f763762..8767393 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -414,7 +414,7 @@
of a cgroup_fs (using
for_each_subsys), cgrp->subsys[ss->subsys_id] won't be NULL,
guaranteed by cgroup_create().
(Also remove 2 unused variables in cgroup_rmdir().
Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
---
There was a compile warning..resend this patch. Sorry for b
Paul Menage wrote:
> On Fri, Nov 21, 2008 at 12:49 AM, Lai Jiangshan <[EMAIL PROTECTED]> wrote:
>> task_cgroup() calls cgroup_subsys_state().
>
> No, it calls task_subsys_state()
>
>> and we must use rcu_read_lock() to protect cgroup_subsys_state().
>> so we must use rcu_read_lock() to protect ta
Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
---
kernel/cgroup.c | 24 ++--
1 files changed, 2 insertions(+), 22 deletions(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index fe00b3b..46d9981 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -84,7 +84,7 @@ stru
Add a common function link_css_set() to link a css_set to a
cgroup.
Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
---
kernel/cgroup.c | 51 ++-
1 files changed, 22 insertions(+), 29 deletions(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
Li Zefan wrote:
> Add a common function link_css_set() to link a css_set to a
> cgroup.
>
> Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
I forgot the patch number..The title should be:
[PATCH 2/2] cgroups: add link_css_set() to rem
Li Zefan wrote:
> - Don't link rootnode to the root list, so root_list contains active
> hierarchies only as the comment indicates.
>
> - Don't link css_sets to the dummy cgroup, because we never want to
> run through the tasks in that dummpy cgroup (which means run
.next == &ss->sibling) {
...
}
}
if (list_empty(&rootnode.subsys_list)) {
...
}
The above code assumes rootnode.subsys_list links all inactive
hierarchies.
Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
---
Add a common function link_css_set() to link a css_set to a cgroup.
Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
---
kernel/cgroup.c | 62 +-
1 files changed, 24 insertions(+), 38 deletions(-)
diff --git a/kernel/cgroup.c b/kernel/cg
.next == &ss->sibling) {
...
}
}
if (list_empty(&rootnode.subsys_list)) {
...
}
The above code assumes rootnode.subsys_list links all inactive
hierarchies.
Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
-
Don't link rootnode to the root list, so root_list contains active
hierarchies only as the comment indicates. And rename for_each_root()
to for_each_active_root().
Also remove redundant check in cgroup_kill_sb().
Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
---
kernel/cgro
Paul Menage wrote:
> On Fri, Nov 28, 2008 at 2:02 AM, Li Zefan <[EMAIL PROTECTED]> wrote:
>> Add a common function link_css_set() to link a css_set to a cgroup.
>>
>> Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
>
> Overall the change looks like an improvem
Paul Menage wrote:
> On Fri, Nov 28, 2008 at 2:02 AM, Li Zefan <[EMAIL PROTECTED]> wrote:
>> Though for an inactive hierarchy, we have subsys->root == &rootnode,
>> but rootnode's root_list is always empty.
>
> I think you mean "rootnode's subsys_l
Paul Menage wrote:
> On Fri, Nov 28, 2008 at 2:02 AM, Li Zefan <[EMAIL PROTECTED]> wrote:
>> Don't link rootnode to the root list, so root_list contains active
>> hierarchies only as the comment indicates. And rename for_each_root()
>> to for_each_active_ro
@@ -2522,6 +2522,7 @@ static void __init cgroup_init_subsys(struct
cgroup_subsys *ss)
printk(KERN_INFO "Initializing cgroup subsys %s\n", ss->name);
/* Create the top cgroup state for this subsystem */
+ list_add(&ss->sibling, &rootnode.root_list);
hy.
> mkdir /mnt/cg
> mount -t cgroup -o ns,freezer cgroup /mnt/cg
> mkdir /mnt/cg/foo
> sleep 1h < /mnt/cg/foo &
> rmdir /mnt/cg/foo
> mount -t cgroup -o remount,ns,devices,freezer cgroup /mnt/cg
> kill $!
>
> Signed-off-by: Paul Menage <[EMAIL PROTECTED]>
>
> +static void cgroup_lock_hierarchy(struct cgroupfs_root *root)
> +{
> + /* We need to take each hierarchy_mutex in a consistent order */
This comment is not so clear. Do you mean for_each_subsys() can't be
used here?
But this function is used in cgroup.c internally, and always called
with c
Balbir Singh wrote:
> * KAMEZAWA Hiroyuki <[EMAIL PROTECTED]> [2008-12-11 10:05:01]:
>
>> On Wed, 10 Dec 2008 16:52:57 -0800
>> Paul Menage <[EMAIL PROTECTED]> wrote:
>>
>>> On Wed, Dec 10, 2008 at 4:49 PM, KAMEZAWA Hiroyuki
>>> <[EMAIL PROTECTED]> wrote:
an operation like rmdir() in s
> /**
> - * cgroup_is_descendant - see if @cgrp is a descendant of current task's cgrp
> + * cgroup_is_descendant - see if @cgrp is a descendant of @task's cgrp
> * @cgrp: the cgroup in question
> + * @task: the task in question
> + * @subsys_id: cgroup subsystem id used to determine hierarchy;
ail with -EPERM and would have to be
> performed as two steps:
> echo $pid > /cgroup/CG1/tasks
> echo $pid > /cgroup/CG1/CG2/tasks
>
Now looks good to me. :)
Reviewed-by: Li Zefan
> Signed-off-by: Grzegorz Nosek
> ---
> include/linux/cgroup.h |4 ++--
>
Gowrishankar M wrote:
> From: Gowrishankar M
>
> In current model, task by task we populate cgroup.
> Incase of multi-threaded task, it becomes difficult
> as we should first know about list of threads created
> and add them one by one in cgroup.
>
It was proposed to add 'procs' control file to
>> Now looks good to me. :)
>>
>> Reviewed-by: Li Zefan
>
> Thanks, shall I send the patch somewhere else for some mainstream tree
> inclusion or is somebody willing to pick it up from here?
>
You can resend this patch to Andrew Morton ,
and CC Paul Menage si
If cgroup_get_rootdir() failed, free_cg_links() will be called
in the failure path, but tmp_cg_links hasn't been initialized
at that time.
I should be blamed to introduce this bug in 2.6.26 merge window.
Signed-off-by: Li Zefan
---
kernel/cgroup.c |5 +++--
1 files changed, 3 inser
Li Zefan wrote:
> If cgroup_get_rootdir() failed, free_cg_links() will be called
> in the failure path, but tmp_cg_links hasn't been initialized
> at that time.
>
> I should be blamed to introduce this bug in 2.6.26 merge window.
>
Sorry, I mean 2.6.27 merge window.
&g
0xf
[] ? sysenter_do_call+0x12/0x31
...
EIP: [] cgroup_kill_sb+0x23/0xe0 SS:ESP 0068:e411ef2c
---[ end trace c766c1be3bf944ac ]---
CC: Serge E. Hallyn
Signed-off-by: Li Zefan
---
affected kernel: 2.6.24 to 2.6.28
---
kernel/cgroup.c |6 +-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/ker
> echo $pid > /cgroup/CG1/tasks
> echo $pid > /cgroup/CG1/CG2/tasks
>
> Signed-off-by: Grzegorz Nosek
> Reviewed-by: Li Zefan
> Cc: Paul Menage
> Cc: Balbir Singh
> Cc: KAMEZAWA Hiroyuki
> Cc: Pavel Emelyanov
> Signed-off-by: Andrew Morton
> -
Andrew Morton wrote:
> On Tue, 06 Jan 2009 09:25:02 +0800 Li Zefan wrote:
>
>> a...@linux-foundation.org wrote:
>>> The patch titled
>>> cgroups: relax ns_can_attach checks to allow attaching to grandchild
>>> cgroups
>>> has b
e.
>
> Signed-off-by: Grzegorz Nosek
Reviewed-by: Li Zefan
> ---
> include/linux/cgroup.h |4 ++--
> kernel/cgroup.c| 11 ++-
> kernel/ns_cgroup.c | 14 --
> 3 files changed, 12 insertions(+), 17 deletions(-)
_
CC: net...@vger.kernel.org
I'll review the cgroup part if this patch is regarded as useful.
Grzegorz Nosek wrote:
> This is a very simple cgroup subsystem to restrict IP addresses used
> by member processes. Currently it is limited to IPv4 only but IPv6 (or
> other protocols) should be easy to im
Grzegorz Nosek wrote:
> On śro, sty 07, 2009 at 02:01:10 +0800, Li Zefan wrote:
>> CC: net...@vger.kernel.org
>>
>> I'll review the cgroup part if this patch is regarded as useful.
>>
>> Grzegorz Nosek wrote:
>>> This is a very simple cgroup subsys
Grzegorz Nosek wrote:
> On śro, sty 07, 2009 at 04:36:35 +0800, Li Zefan wrote:
>> Grzegorz Nosek wrote:
>>>>> IP addresses are write-once (via /cgroup/.../ipaddr.ipv4 in dotted-quad
>>>> Why they should be write-once ?
>>> No real (technical) reaso
- move CONFIG_PROC_PID_CPUSET into cgroup menu
- move MM_OWNER to the bottom for better menu indent
- fix typos
- use tabs not spaces
Signed-off-by: Li Zefan
---
init/Kconfig | 56
1 files changed, 28 insertions(+), 28 deletions
Paul Menage wrote:
> On Wed, Jan 7, 2009 at 1:33 AM, Li Zefan wrote:
>>> Yes, I like that. Will update the patch. I assume that I must check
>>> list_empty(&cgroup->children)?
>> Yes.
>>
>>> Should I use cgroup_lock()/cgroup_unlock()
>> Y
Paul Menage wrote:
> On Fri, Jan 9, 2009 at 8:50 PM, Li Zefan wrote:
>>> For checking the "children" list, you can just lock
>>> ipaddr_subsys.hierarchy_mutex.
>>>
>> Unfortunately hierarchy_mutex can't be used here, since hierarchy_mutex
&
>> /**
>> - * cgroup_is_descendant - see if @cgrp is a descendant of current task's
>> cgrp
>> + * cgroup_is_descendant - see if @cgrp is a descendant of @task's cgrp
>> * @cgrp: the cgroup in question
>> + * @task: the task in question
>> *
>> - * See if @cgrp is a descendant of the current
> That would be possible, but I'm not sure that extending
> hierarchy_mutex across all the create calls is a good idea - it's
> meant to be very lightweight.
>
agree
> OK, an alternative way to avoid cgroup_lock() is for the
> spinlock-protected state in ipcgroup to be the address and the count
ecking cgrp->children,
that a cgroup is removed from parent's list in cgroup_rmdir(),
while memcg->child_count is decremented in cgroup_diput().
Signed-off-by: Li Zefan
---
mm/memcontrol.c | 10 +-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/mm/memcon
KAMEZAWA Hiroyuki wrote:
> On Wed, 14 Jan 2009 11:24:18 +0800
> Li Zefan wrote:
>
>> (suppose: memcg->use_hierarchy == 0 and memcg->swappiness == 60)
>>
>> echo 10 > /memcg/0/swappiness |
>> mem_cgroup_swappiness_write() |
>> ...
KAMEZAWA Hiroyuki wrote:
> On Wed, 14 Jan 2009 14:47:18 +0800
> Li Zefan wrote:
>
>> KAMEZAWA Hiroyuki wrote:
>>> On Wed, 14 Jan 2009 11:24:18 +0800
>>> Li Zefan wrote:
>>>
>>>> (suppose: memcg->use_hierarchy == 0 and memcg-&
I fixed a bug in cgroup_clone() in Linus' tree (commit 7b574b7), without
noticing there was a cleanup patch in -mm tree that should be rebased
(now commit 104cbd5), thus resulted in lock inconsistency.
Signed-off-by: Li Zefan
---
for 2.6.29
---
kernel/cgroup.c | 13 +++--
1
, but
MAX_LOCKDEP_SUBCLASSES is 8.
This patch uses different lockdep keys for different subsystems.
Signed-off-by: Li Zefan
---
include/linux/cgroup.h |1 +
kernel/cgroup.c|3 ++-
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/include/linux/cgroup.h b/include/
Li Zefan wrote:
> I enabled all cgroup subsystems when compiling kernel, and then:
> # mount -t cgroup -o net_cls xxx /mnt
> # mkdir /mnt/0
>
> This showed up immediately:
> BUG: MAX_LOCKDEP_SUBCLASSES too low!
> turning off the locking correctness validator.
>
>
Andrew Morton wrote:
> (cc's added)
>
> On Mon, 05 Jan 2009 11:23:33 +0800 Li Zefan wrote:
>
>> Thread 1:
>> for ((; ;))
>> {
>> mount -t cgroup -o cpuset xxx /mnt > /dev/null 2>&1
>> mkdir /mnt/0 > /dev/null 2>
Al Viro wrote:
> On Mon, Feb 09, 2009 at 12:40:46AM -0800, Andrew Morton wrote:
>>> Thread 1:
>>> for ((; ;))
>>> {
>>> mount -t cgroup -o cpuset xxx /mnt > /dev/null 2>&1
>>> mkdir /mnt/0 > /dev/null 2>&1
>>> rmdir /mnt/0 > /dev/null 2>&1
>>> umount /mnt > /dev/null 2>&
Al Viro wrote:
> On Mon, Feb 09, 2009 at 11:03:48AM +, Al Viro wrote:
>> BTW, a trivial note - kfree(root) in your ->kill_sb() is done
>> earlier than it's nice to do. Shouldn't affect the problem, though.
>
Do you mean kfree(root) should be called after kill_litter_super()?
I don't see
In cgroup_kill_sb(), root is freed before sb is detached from the list,
so another sget() may find this sb and call cgroup_test_super(),
which will access the root that has been freed.
Reported-by: Al Viro
Signed-off-by: Li Zefan
---
kernel/cgroup.c |2 +-
1 files changed, 1 insertions
Li Zefan wrote:
> Al Viro wrote:
>> On Mon, Feb 09, 2009 at 12:40:46AM -0800, Andrew Morton wrote:
>>>> Thread 1:
>>>> for ((; ;))
>>>> {
>>>> mount -t cgroup -o cpuset xxx /mnt > /dev/null 2>&1
>>>&g
How cute... Same mountpoint in both, so these mount(2) will sometimes
fail (cgroup picks the same sb on the same options, AFAICS) and fail
silently due to these redirects...
That's a lovely way to stress-test a large part of ro-bind stuff *and*
umount()-related code.
Li Zefan wrote:
>>>>> How cute... Same mountpoint in both, so these mount(2) will sometimes
>>>>> fail (cgroup picks the same sb on the same options, AFAICS) and fail
>>>>> silently due to these redirects...
>>>>>
>>>>
>> thread 1:
>> for ((; ;))
>> {
>> mount -t cgroup -o ns xxx cgroup/ > /dev/null 2>&1
>> # remove the dirs generated by cgroup_clone()
>> rmdir cgroup/[1-9]* > /dev/null 2>&1
>> umount cgroup/ > /dev/null 2>&1
>> }
>>
>>
>> thread 2:
>>
>> int foo(void *arg)
>> { return 0; }
>>
Al Viro wrote:
> On Fri, Feb 13, 2009 at 01:09:17PM +0800, Li Zefan wrote:
>
>> I ran following testcase, and triggered the warning in 1 hour:
>>
>> thread 1:
>> for ((; ;))
>> {
>> mount --bind /cgroup /mnt > /dev/null 2>&1
>&g
Li Zefan wrote:
> Al Viro wrote:
>> On Fri, Feb 13, 2009 at 01:09:17PM +0800, Li Zefan wrote:
>>
>>> I ran following testcase, and triggered the warning in 1 hour:
>>>
>>> thread 1:
>>> for ((; ;))
>>> {
>>> mount --bin
Al Viro wrote:
> On Fri, Feb 13, 2009 at 06:41:35AM +, Al Viro wrote:
>
> Aaaargh...
>
> /*
> * We don't have to hold all of the locks at the
> * same time here because we know that we're the
> * last reference to mnt and that no new writers
> * can
Li Zefan wrote:
> Al Viro wrote:
>> On Fri, Feb 13, 2009 at 06:41:35AM +, Al Viro wrote:
>>
>> Aaaargh...
>>
>> /*
>> * We don't have to hold all of the locks at the
>> * same time here because we know that we're
done by another
> CPU.
>
If this is done, I'll be available to test it.
> Anyway, for now (HEAD and all -stable starting with 2.6.26) we want this:
>
And here is my:
Tested-by: Li Zefan
> --- fs/namespace.c2009-01-25 21:45:31.00
The css_set hash table was introduced in 2.6.26, so update the documentation
accordingly.
Signed-off-by: Li Zefan
---
Documentation/cgroups/cgroups.txt |6 ++
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/Documentation/cgroups/cgroups.txt
b/Documentation/cgroups
> 1. Documentation/cgroups/cgroup.txt says
>#mount -oremount,cpuset,ns /dev/cgroup
>But this should be
>#mount -tcgroup none /dev/cgroup -oremount,cpuset,ns
>
I agree. Actually I noticed this long ago.
Doing this won't remove cpuacct from the cgroup hierarchy:
# mount -t cgroup -o cp
KAMEZAWA Hiroyuki wrote:
> Paul Menage さんは書きました:
>> On Fri, Feb 20, 2009 at 2:02 AM, KAMEZAWA Hiroyuki
>> wrote:
>>> 2. /proc/mounts information of release_agent should be updated
>>> when it's overwritten directly.
>> Yes, definitely. But shouldn't that happen already?
>> cgroup_show_option
Li Zefan wrote:
>> 1. Documentation/cgroups/cgroup.txt says
>>#mount -oremount,cpuset,ns /dev/cgroup
>>But this should be
>>#mount -tcgroup none /dev/cgroup -oremount,cpuset,ns
>>
>
> I agree. Actually I noticed this long ago.
>
> Doing
KAMEZAWA Hiroyuki wrote:
> On Mon, 23 Feb 2009 10:32:46 +0800
> Li Zefan wrote:
>
>> KAMEZAWA Hiroyuki wrote:
>>> Paul Menage さんは書きました:
>>>> On Fri, Feb 20, 2009 at 2:02 AM, KAMEZAWA Hiroyuki
>>>> wrote:
>>>>> 2. /proc/mounts infor
>> To change the set of subsystems bound to a mounted hierarchy, just
>> remount with different options:
>> +# mount -o remount,cpuset,ns hier1 /dev/cgroup
>>
>> -# mount -o remount,cpuset,ns /dev/cgroup
>> +Now numtasks is removed from the hierarchy and ns is added.
>> +
>> +Note this will ad
Also document how to specify or change release_agent.
Signed-off-by: Li Zefan
---
Documentation/cgroups/cgroups.txt | 20 ++--
1 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/Documentation/cgroups/cgroups.txt
b/Documentation/cgroups/cgroups.txt
index 93feb84..df
al issue, that some files are
read-only in top-cgroup, but read-write in sub-dirs, like cpuset.cpus and
cpuset.mems. But for those files, they must have a write function, so I think
it's still valid to mask them as read-write even they are in top-cgroup.
Unless Paul has different option towar
> But I don't see why we can't figure out the mode automatically based
> on whether or not there's a write handler defined for the control
> file.
>
This almost works.. except for 'tasks' file, which has no 'read' handler
but is readable.
___
Container
Now a cgroup subsystem can set default file mode of its control files,
so here is a patchset to correct file mode of each subsystem's files.
Should be applied after:
cgroup-allow-subsys-to-set-default-mode-of-its-own-file.patch
[PATCH 1/4] cgroup debug: show correct file mode
[PATCH 2/4]
All control files in debug subsystem are read-only.
Signed-off-by: Li Zefan
---
kernel/cgroup_debug.c |5 +
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/kernel/cgroup_debug.c b/kernel/cgroup_debug.c
index daca620..2ba54c6 100644
--- a/kernel/cgroup_debug.c
+++ b/kernel
cpuacct.usage_percpu is read-only.
Signed-off-by: Li Zefan
---
kernel/sched.c |1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index e66f009..638aa4d 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -9734,6 +9734,7 @@ static struct
devices.allow and devices.deny are write-only, and devices.list is read-only.
Signed-off-by: Li Zefan
---
security/device_cgroup.c |3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/security/device_cgroup.c b/security/device_cgroup.c
index 3aacd0f..b13fbb8 100644
--- a
cpuset.memory_pressure is read-only.
Signed-off-by: Li Zefan
---
kernel/cpuset.c |1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index a46d693..1ed507c 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -1671,6 +1671,7 @@ static
1 - 100 of 403 matches
Mail list logo