err_unload;
-
Moving online_css() upwards should be fine.
Acked-by: Li Zefan lize...@huawei.com
/* success! */
mutex_unlock(cgroup_mutex);
return 0;
-err_unload:
+free_css:
+ list_del(ss-sibling);
+ ss-css_free(css);
+out_err:
+ /* failure case - need
On 2013/12/6 5:18, Tejun Heo wrote:
Hello, Vladimir.
Thanks a lot for the report and fix; however, I really wanna make sure
that only online css's become visible, so I wrote up a different fix.
Can you please test this one?
Oh, I spotted this bug when reviewing a bug fix months ago.
+static void disarm_static_keys(struct mem_cgroup *memcg)
+{
+#ifdef CONFIG_INET
+ if (memcg-tcp_mem.cg_proto.activated)
+ static_key_slow_dec(memcg_socket_limit_enabled);
+#endif
+}
Move this inside the ifdef/endif below ?
Otherwise I think you'll get compile error if
Glauber Costa wrote:
On 04/23/2012 11:31 PM, KAMEZAWA Hiroyuki wrote:
(2012/04/24 4:37), Glauber Costa wrote:
Most of the destroy functions are only doing very simple things
like freeing memory.
The ones who goes through lists and such, already use its own
locking for those.
* The
Glauber Costa wrote:
On 04/19/2012 07:57 PM, Tejun Heo wrote:
On Thu, Apr 19, 2012 at 07:49:17PM -0300, Glauber Costa wrote:
Most of the destroy functions are only doing very simple things
like freeing memory.
The ones who goes through lists and such, already use its own
locking for those.
Glauber Costa wrote:
Hello Tejun,
During your cgroup refactor, I was wondering if you have any plans to get rid
of the bind() callback that is called when hierarchies are moved?
I planned to remove it long ago, and Paul M agreed. But after some time, I was
trying to make use of it in a
Tejun Heo wrote:
On Thu, Apr 19, 2012 at 07:49:17PM -0300, Glauber Costa wrote:
Most of the destroy functions are only doing very simple things
like freeing memory.
The ones who goes through lists and such, already use its own
locking for those.
* The cgroup itself won't go away until we
.
Signed-off-by: Glauber Costa glom...@parallels.com
CC: Paul Turner p...@google.com
CC: Li Zefan l...@cn.fujitsu.com
---
kernel/cgroup.c |4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 1fd7867..e894a4f 100644
--- a/kernel
于 2011年12月13日 23:41, Tejun Heo 写道:
On Sun, Dec 11, 2011 at 03:45:38PM +0100, Glauber Costa wrote:
There is no reason to have a flags field, and then a separate
bool field just to indicate if 'none' subsystem were explicitly
requested.
Make it a flag
Signed-off-by: Glauber Costa
22:45, Glauber Costa wrote:
Those are quite simple bit-testing functions that are
only used within this file. Not reason for them not to
be inline.
It's better to leave the optimization decision to gcc.
And I've confirmed they are inlined by gcc in my box.
(btw, please add cgroup prefix to
,
jirka
and this should be excluded from the changelog.
Signed-off-by: Jiri Olsa jo...@redhat.com
Reviewed-by: Li Zefan l...@cn.fujitsu.com
However a nitpick:
---
include/linux/cgroup.h |1 -
kernel/cgroup.c|6 ++
2 files changed, 2 insertions(+), 5 deletions
In mem_cgroup_alloc() we currently do either kmalloc() or vmalloc() then
followed by memset() to zero the memory. This can be more efficiently
achieved by using kzalloc() and vzalloc().
There's also one situation where we can use kzalloc_node() - this is
what's new in this version of the
jacob pan wrote:
On Wed, 09 Feb 2011 11:07:59 +0800
Li Zefan l...@cn.fujitsu.com wrote:
jacob.jun@linux.intel.com wrote:
From: Jacob Pan jacob.jun@linux.intel.com
Freezer subsystem is used to manage batch jobs which can start
stop at the same time. However, sometime
jacob.jun@linux.intel.com wrote:
From: Jacob Pan jacob.jun@linux.intel.com
Freezer subsystem is used to manage batch jobs which can start
stop at the same time. However, sometime it is desirable to let
the kernel manage the freezer state automatically with a given
duty ratio.
For
Andrew Morton wrote:
On Tue, 25 Jan 2011 10:39:48 +0100
Daniel Lezcano daniel.lezc...@free.fr wrote:
This patch removes the ns_cgroup as suggested in the following thread:
I had this patch queued up in September last year, but dropped it. Why
did I do that?
Because you wanted to wait
lock order annotation, but
mainline cgroupfs code looks to be OK there. What does
cgroup_clear_directory() look like in mmotm?
It's not from cgroup_clear_directory()..
This should fix it:
=
From: Li Zefan l...@cn.fujitsu.com
Date: Fri, 14 Jan 2011 11:34:34 +0800
Subject
Just mount the cgroupfs:
# mount -t cgroup -o cpuset xxx /mnt
(oops!!)
The bug is caused by:
=
commit 0df6a63f8735a7c8a877878bc215d4312e41ef81
Author: Al Viro v...@zeniv.linux.org.uk
Date: Tue Dec 21 13:29:29 2010 -0500
switch cgroup
switching it to s_d_op allows to kill
Al Viro wrote:
On Fri, Jan 14, 2011 at 12:56:17PM +0800, Li Zefan wrote:
Just mount the cgroupfs:
# mount -t cgroup -o cpuset xxx /mnt
(oops!!)
The bug is caused by:
=
commit 0df6a63f8735a7c8a877878bc215d4312e41ef81
Author: Al Viro v...@zeniv.linux.org.uk
Date: Tue Dec 21 13
David Rientjes wrote:
On Wed, 29 Dec 2010, Li Zefan wrote:
I think it would be appropriate to use a shared nodemask with file scope
whenever you have cgroup_lock() to avoid the unnecessary kmalloc() even
with GFP_KERNEL. Cpusets are traditionally used on very large machines in
the first
David Rientjes wrote:
On Thu, 30 Dec 2010, Li Zefan wrote:
That's what we did for cpu masks :). See commit
2341d1b6598c7146d64a5050b53a72a5a819617f.
I made a patchset to remove on stack cpu masks.
What I meant is we don't have to allocate nodemasks in
cpuset_sprintf_memlist
David Rientjes wrote:
On Mon, 27 Dec 2010, Ben Blum wrote:
I'm not sure what the benefit of defining it as a macro would be. You're
defining these statically allocated nodemasks so they have file scope, I
hope (so they can be shared amongst the users who synchronize on
cgroup_lock()
Stephane posted a patchset to add perf_cgroup subsystem, so perf can
be used to monitor all threads belonging to a cgroup.
But if you already mounted a cgroup hierarchy but without perf_cgroup
and the hierarchy has sub-cgroups, you can't bind perf_cgroup to it,
and thus you're not able to use
On x86_32, sizeof(struct cgroup_subsys) shrinks from 276 bytes
to 264.
Acked-by: Paul Menage men...@google.com
Signed-off-by: Li Zefan l...@cn.fujitsu.com
---
include/linux/cgroup.h | 10 ++
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/include/linux/cgroup.h b/include
.
Signed-off-by: Li Zefan l...@cn.fujitsu.com
---
include/linux/cgroup.h | 17 ++
kernel/cgroup.c| 139 +--
2 files changed, 138 insertions(+), 18 deletions(-)
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index d8c4e22..17579b2
For now unbindable subsystems should not use css_get/put(), so check
this misuse.
Signed-off-by: Li Zefan l...@cn.fujitsu.com
---
include/linux/cgroup.h |7 +--
kernel/cgroup.c|5 +
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/include/linux/cgroup.h b
For those subsystems (debug, cpuacct, net_cls and devices),
setting the bindable/unbindable flag is sufficient.
Set freezer subsystem as bindable but not unbindable, because
sub-cgroups' can be in FROZEN state.
Signed-off-by: Li Zefan l...@cn.fujitsu.com
---
kernel/cgroup.c |6
Provide a usage example, update the bind() callback API, etc.
Signed-off-by: Li Zefan l...@cn.fujitsu.com
---
Documentation/cgroups/cgroups.txt | 37 +
1 files changed, 29 insertions(+), 8 deletions(-)
diff --git a/Documentation/cgroups/cgroups.txt
b
ccmail111 wrote:
Hi Serge,
Now I cannot move the pid out of the assigned group !
Try:
$ sudo echo 580 tasks
[host:/dev/cgroup]$ cat cpuset.cpus
0
[host:/dev/cgroup]$ cat cpuset.mems
0
[host:/dev/cgroup]$ cat hello/tasks
580
[host:/dev/cgroup]$ echo 580 tasks
-bash: echo:
12:06, Colin Cross wrote:
The synchronize_rcu call in cgroup_attach_task can be very
expensive. All fastpath accesses to task-cgroups that expect
task-cgroups not to change already use task_lock() or
cgroup_lock() to protect against updates, and, in cgroup.c,
only the CGROUP_DEBUG files have
Paul Menage wrote:
On Sun, Nov 21, 2010 at 8:06 PM, Colin Cross ccr...@android.com wrote:
The synchronize_rcu call in cgroup_attach_task can be very
expensive. All fastpath accesses to task-cgroups that expect
task-cgroups not to change already use task_lock() or
cgroup_lock() to protect
Ben Gamari wrote:
I've been trying to configure cgroups and have encountered some very
strange behavior. In particular, when I follow the instructions in
Documentation/cgroups/blkio-controller.txt I quickly reach an error,
$ cd /mnt
$ sudo mkdir -p cgroups/blkio
$ # Confirm it's not
Paul Menage wrote:
On Sun, Nov 7, 2010 at 9:23 PM, Li Zefan l...@cn.fujitsu.com wrote:
bool active;
bool disabled;
...
?
With alignment 5-8 bool values == 8 bytes in 64-bit machine, compared to
4 bytes with the approach this patch takes.
I meant specifying it as:
bool active:1
Paul Menage wrote:
On Tue, Nov 9, 2010 at 4:52 PM, Li Zefan l...@cn.fujitsu.com wrote:
bool active:1;
bool disabled:1;
It won't compile, but unsigned char active:1 will do. ;)
Are you sure? I don't have a buildable kernel tree at the moment, but
the following fragment compiled fine for me
(Sorry for the delayed reply)
Paul Menage wrote:
On Fri, Oct 22, 2010 at 1:09 AM, Li Zefan l...@cn.fujitsu.com wrote:
On x86_32, sizeof(struct cgroup_subsys) shrinks from 276 bytes
to 264.
Signed-off-by: Li Zefan l...@cn.fujitsu.com
Acked-by: Paul Menage men...@google.com
Maybe use
Paul Menage wrote:
On Fri, Oct 22, 2010 at 1:09 AM, Li Zefan l...@cn.fujitsu.com wrote:
+ /*
+* Indicate if this subsystem can be bound/unbound to/from a cgroup
+* hierarchy which has child cgroups.
+*/
+ unsigned int can_bind:1;
Maybe call
Paul Menage wrote:
Called when a cgroup subsystem is rebound to a different hierarchy
-and root cgroup. Currently this will only involve movement between
-the default hierarchy (which never has sub-cgroups) and a hierarchy
-that is being created/destroyed (and hence has no sub-cgroups).
+and
KAMEZAWA Hiroyuki wrote:
On Fri, 22 Oct 2010 16:12:25 +0800
Li Zefan l...@cn.fujitsu.com wrote:
Provide a usage example, and update the bind() callback API.
Signed-off-by: Li Zefan l...@cn.fujitsu.com
---
Documentation/cgroups/cgroups.txt | 26 +-
1 files
Li Zefan wrote:
KAMEZAWA Hiroyuki wrote:
On Fri, 22 Oct 2010 16:12:25 +0800
Li Zefan l...@cn.fujitsu.com wrote:
Provide a usage example, and update the bind() callback API.
Signed-off-by: Li Zefan l...@cn.fujitsu.com
---
Documentation/cgroups/cgroups.txt | 26
Peter Zijlstra wrote:
On Fri, 2010-10-22 at 16:09 +0800, Li Zefan wrote:
For example, we can't decide a cgroup's cpuset.mems and
cpuset.cpus automatically, so cpuset is not bindable.
You mean to say that you cannot add cpuset to an existing hierarchy
right? Not that you cannot add perf
Peter Zijlstra wrote:
On Fri, 2010-10-22 at 16:09 +0800, Li Zefan wrote:
Stephane posted a patchset to add perf_cgroup subsystem, so perf can
be used to monitor all threads belonging to a cgroup.
But if you already mounted a cgroup hierarchy but without perf_cgroup
and the hierarchy has sub
+/*
+ * cgroup_walk_herarchy - iterate through a cgroup hierarchy
+ * @process_cgroup: callback called on each cgroup in the hierarchy
+ * @data: will be passed to @process_cgroup
+ * @top_cgrp: the root cgroup of the hierarchy
+ *
+ * For such a hierarchy:
+ *a1c1
+ *
On x86_32, sizeof(struct cgroup_subsys) shrinks from 276 bytes
to 264.
Signed-off-by: Li Zefan l...@cn.fujitsu.com
---
include/linux/cgroup.h | 10 ++
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index ed4ba11..e23ded6
Stephane posted a patchset to add perf_cgroup subsystem, so perf can
be used to monitor all threads belonging to a cgroup.
But if you already mounted a cgroup hierarchy but without perf_cgroup
and the hierarchy has sub-cgroups, you can't bind perf_cgroup to it,
and thus you're not able to use
(remove it from the hierarchy)
# mount -o remount,cpuset xxx /mnt
Signed-off-by: Li Zefan l...@cn.fujitsu.com
---
kernel/cgroup.c | 76 ---
1 files changed, 61 insertions(+), 15 deletions(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index
, and we add cpuacct to the hierarchy)
# mount -o remount,cpuset,cpuacct xxx /mnt
Signed-off-by: Li Zefan l...@cn.fujitsu.com
---
include/linux/cgroup.h |5 +
kernel/cgroup.c| 225 ++-
2 files changed, 187 insertions(+), 43 deletions(-)
diff
For those subsystems (debug, cpuacct, net_cls and devices),
setting the can_bind flag is sufficient.
Signed-off-by: Li Zefan l...@cn.fujitsu.com
---
kernel/cgroup.c |1 +
kernel/sched.c |1 +
net/sched/cls_cgroup.c |1 +
security/device_cgroup.c |1 +
4 files
To make it bindable, we need to thaw all processes when unbinding
the freezer subsystem from a cgroup hierarchy.
Signed-off-by: Li Zefan l...@cn.fujitsu.com
---
include/linux/cgroup.h |3 ++-
kernel/cgroup.c | 22 --
kernel/cgroup_freezer.c | 19
For now bindable subsystems should not use css_get/put(), so warn
on this misuse.
Signed-off-by: Li Zefan l...@cn.fujitsu.com
---
include/linux/cgroup.h |7 +--
kernel/cgroup.c|3 +++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/include/linux/cgroup.h b
Provide a usage example, and update the bind() callback API.
Signed-off-by: Li Zefan l...@cn.fujitsu.com
---
Documentation/cgroups/cgroups.txt | 26 +-
1 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/Documentation/cgroups/cgroups.txt
b/Documentation
Stephen Hemminger wrote:
While running namespace checks to look for dead code,
I found that debug_subsys is declared global but never
used in current code.
This leads to the fact that since debug_subsys is never
used, the whole set of debugging functions is also never
used. Is the whole
Stephen Hemminger wrote:
On Tue, 19 Oct 2010 18:14:10 -0700
Paul Menage men...@google.com wrote:
On Tue, Oct 19, 2010 at 6:12 PM, Stephen Hemminger
shemmin...@vyatta.com wrote:
Where is it stored in an array?
~/kernel/linux-2.6$ git grep debug_subsys
kernel/cgroup.c:
Stephen Hemminger wrote:
On Wed, 20 Oct 2010 09:43:06 +0800
Li Zefan l...@cn.fujitsu.com wrote:
Stephen Hemminger wrote:
On Tue, 19 Oct 2010 18:14:10 -0700
Paul Menage men...@google.com wrote:
On Tue, Oct 19, 2010 at 6:12 PM, Stephen Hemminger
shemmin...@vyatta.com wrote:
Where
Daniel Lezcano wrote:
The different cgroup subsystems are under the cgroup submenu.
The dependency between the cgroups and the menu subsystems is
pointless.
Indead.
Signed-off-by: Daniel Lezcano daniel.lezc...@free.fr
Acked-by: Li Zefan l...@cn.fujitsu.com
---
init/Kconfig | 14
...@redhat.com
Acked-by: Li Zefan l...@cn.fujitsu.com
I also don't like the name, but I'm not good at English or naming. ;)
---
Paul, Li, Sridhar, could you please review the following
patch?
I only compile-tested it due to travel, but looks
straight-forward to me.
Alex Williamson
-by: Serge E. Hallyn serge.hal...@canonical.com
Cc: Eric W. Biederman ebied...@xmission.com
Cc: Paul Menage men...@google.com
Reviewed-by: Li Zefan l...@cn.fujitsu.com
___
Containers mailing list
contain...@lists.linux-foundation.org
https://lists.linux
...@xmission.com
Cc: Paul Menage men...@google.com
Cc: Jamal Hadi Salim h...@cyberus.ca
Reviewed-by: Li Zefan l...@cn.fujitsu.com
___
Containers mailing list
contain...@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
...@google.com
Reviewed-by: Li Zefan l...@cn.fujitsu.com
___
Containers mailing list
contain...@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
___
Devel mailing list
Devel
Andrew Morton wrote:
On Fri, 30 Jul 2010 19:56:49 -0400
Ben Blum bb...@andrew.cmu.edu wrote:
This patch series implements a write function for the 'cgroup.procs'
per-cgroup file, which enables atomic movement of multithreaded
applications between cgroups. Writing the thread-ID of any thread
Masanari Iida wrote:
Fix command example in cpuacct.txt
Signed-off-by: Masanari Iida standby2...@gmail.com
Obviously correct..
Acked-by: Li Zefan l...@cn.fujitsu.com
---
Documentation/cgroups/cpuacct.txt |2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git
Catch.
Acked-by: KAMEZAWA Hiroyuki kamezawa.hir...@jp.fujitsu.com
But, who breaks this ? Do we need backport this against old kernels ?
Oops, I broke it, and it needs to be backported to 2.6.34..
Thanks for catching this!
Acked-by: Li Zefan l...@cn.fujitsu.com
On Fri, May 28, 2010 at 8:16 AM, Greg Thelen gthe...@google.com wrote:
Signed-off-by: Greg Thelen gthe...@google.com
Acked-by: Paul Menage men...@google.com
Good catch, thanks.
Nice Catch.
Acked-by: KAMEZAWA Hiroyuki kamezawa.hir...@jp.fujitsu.com
But, who breaks this ? Do we need
or cgroup_mutex held.
Signed-off-by: Li Zefan l...@cn.fujitsu.com
---
kernel/cgroup.c | 12 +---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index e2769e1..4ca928d 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1646,7 +1646,9
With CONFIG_PROVE_RCU=y, a warning can be triggered:
# mount -t cgroup -o memory xxx /mnt
# mkdir /mnt/0
...
kernel/cgroup.c:4442 invoked rcu_dereference_check() without protection!
...
This is a false-positive. It's safe to directly access parent_css-id.
Signed-off-by: Li Zefan l
With CONFIG_PROVE_RCU=y, a warning can be triggered:
$ cat /proc/sched_debug
...
kernel/cgroup.c:1649 invoked rcu_dereference_check() without protection!
...
Both cgroup_path() and task_group() should be called with either
rcu_read_lock or cgroup_mutex held.
Signed-off-by: Li Zefan l
with CONFIG_PROVE_RCU, a warning can be triggered when we
resume from suspend:
...
include/linux/cgroup.h:533 invoked rcu_dereference_check() without protection!
...
task_freezer() calls task_subsys_state(), which needs to be
protected by rcu_read_lock or cgroup_mutex.
Signed-off-by: Li Zefan l
.
Signed-off-by: Li Zefan l...@cn.fujitsu.com
---
block/blk-cgroup.c |8
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 5fe03de..2cc682b 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -286,16 +286,16 @@ done:
static
-by: Li Zefan l...@cn.fujitsu.com
---
kernel/cgroup_freezer.c |2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
index 5038f4c..ac76983 100644
--- a/kernel/cgroup_freezer.c
+++ b/kernel/cgroup_freezer.c
@@ -53,6 +53,7
task_subsys_state() is safe under task_lock(). See
Documentation/cgroups/cgroups.txt for locking rule.
This fixes an RCU warning when resume from suspend. The
warning comes from freezer cgroup in cgroup_freezing_or_frozen().
Signed-off-by: Li Zefan l...@cn.fujitsu.com
---
I'm not sure which
---help---
Generic block IO controller cgroup interface. This is the common
@@ -91,7 +92,7 @@ config BLK_CGROUP
to such task groups.
config DEBUG_BLK_CGROUP
-bool
+bool Block cgroup debugging help
Why are you making DEBUG_BLK_CGROUP this as a user
Jens Axboe wrote:
On Mon, Mar 15 2010, Li Zefan wrote:
Make the config visible, so we can choose from CONFIG_BLK_CGROUP=y
and CONFIG_BLK_CGROUP=m when CONFIG_IOSCHED_CFQ=m.
Signed-off-by: Li Zefan l...@cn.fujitsu.com
What kernel is this against?
It's against linus' tree. I've just
Make the config visible, so we can choose from CONFIG_BLK_CGROUP=y
and CONFIG_BLK_CGROUP=m when CONFIG_IOSCHED_CFQ=m.
Signed-off-by: Li Zefan l...@cn.fujitsu.com
---
block/Kconfig |5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/block/Kconfig b/block/Kconfig
index
commit e6a1105b (cgroups: subsystem module loading interface)
and commit c50cc752 (sched, cgroups: Fix module export)
result in duplicate including of cgroup.h
Signed-off-by: Li Zefan l...@cn.fujitsu.com
---
kernel/cgroup.c |1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git
Kirill A. Shutemov wrote:
glibc's dprintf(3) is buggy:
http://sourceware.org/bugzilla/show_bug.cgi?id=11319
Let's not to use it in the example.
Signed-off-by: Kirill A. Shutemov kir...@shutemov.name
Reviewed-by: Li Zefan l...@cn.fujitsu.com
Kirill A. Shutemov wrote:
On Wed, Feb 24, 2010 at 5:22 AM, Li Zefan l...@cn.fujitsu.com wrote:
How to reproduce:
# mount -t cgroup -o memory xxx /cgroup
# mkdir /cgroup/tmp
# ./cgroup_event_listener /cgroup/tmp/cgroup.event_control abc
^C
# rmdir /cgroup/tmp
# cat /proc/cgroups
!)
Using a single goto label to cleanup multi failure paths can
get things wrong quite easily, while multi labels makes the
code cleaner.
Signed-off-by: Li Zefan l...@cn.fujitsu.com
---
cgroup.c | 39 ++-
1 file changed, 18 insertions(+), 21 deletions(-)
diff
+ ret = dprintf(event_control, %d %d %s, efd, cfd, argv[2]);
I found it won't return negative value for invalid input, though
errno is set properly.
try:
# ./cgroup_event_listner /cgroup/cgroup.procs abc
while strace shows write() does return -1:
# strace ./cgroup_event_listner
exists. To avoid race beetween userspace and kernelspace we have
to notify userspace about cgroup removing only after rmdir of cgroup
directory.
Signed-off-by: Kirill A. Shutemov kir...@shutemov.name
Reviewed-by: KAMEZAWA Hiroyuki kamezawa.hir...@jp.fujitsu.com
Acked-by: Li Zefan l
...@jp.fujitsu.com
Looks good.
Acked-by: Li Zefan l...@cn.fujitsu.com
___
Containers mailing list
contain...@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
___
Devel
Kirill A. Shutemov wrote:
An example of cgroup notification API usage.
Signed-off-by: Kirill A. Shutemov kir...@shutemov.name
Reviewed-by: KAMEZAWA Hiroyuki kamezawa.hir...@jp.fujitsu.com
Acked-by: Li Zefan l...@cn.fujitsu.com
___
Containers
Don't Call get_pid_ns() before we locate/alloc the ns.
Signed-off-by: Li Zefan l...@cn.fujitsu.com
---
cgroup.c |8 +++-
1 file changed, 3 insertions(+), 5 deletions(-)
--- a/kernel/cgroup.c.orig 2010-01-26 14:24:29.0 +0800
+++ a/kernel/cgroup.c 2010-01-26 14:24
Jens Axboe wrote:
On Tue, Jan 12 2010, Ben Blum wrote:
Convert blk-cgroup to be buildable as a module
From: Ben Blum bb...@andrew.cmu.edu
This patch modifies the Block I/O cgroup subsystem to be able to be built as
a
module. As the CFQ disk scheduler optionally depends on blk-cgroup,
Kirill A. Shutemov wrote:
On Thu, Jan 7, 2010 at 3:01 AM, Paul Menage men...@google.com wrote:
On Wed, Dec 30, 2009 at 7:57 AM, Kirill A. Shutemov
kir...@shutemov.name wrote:
+
+ if (!IS_ERR(efile))
+ fput(efile);
While this is OK currently, it's a bit fragile. efile
KAMEZAWA Hiroyuki wrote:
On Wed, 6 Jan 2010 20:26:06 -0500
Ben Blum bb...@andrew.cmu.edu wrote:
On Wed, Jan 06, 2010 at 04:04:14PM -0800, Andrew Morton wrote:
On Thu, 31 Dec 2009 00:10:50 -0500
Ben Blum bb...@andrew.cmu.edu wrote:
This patch series implements support for building,
+ write_lock(css_set_lock);
+ for (i = 0; i CSS_SET_TABLE_SIZE; i++) {
+ struct css_set *cg;
+ struct hlist_node *node, *tmp;
+ struct hlist_head *bucket = css_set_table[i], *new_bucket;
Please add a blank line between variable declaration and other code.
subsystems are not present or may appear/disappear.
Signed-off-by: Ben Blum bb...@andrew.cmu.edu
Acked-by: Li Zefan l...@cn.fujitsu.com
...
A small nitpick:
+/* This define indicates the maximum number of subsystems that can be loaded
+ * at once. We limit to this many since cgroupfs_root
pointer in struct cgroup_subsys.
Several functions that might be wanted by modules have had EXPORT_SYMBOL added
to them, but it's unclear exactly which functions want it and which won't.
Signed-off-by: Ben Blum bb...@andrew.cmu.edu
Acked-by: Li Zefan l...@cn.fujitsu.com
Some small nitpicks
the subsys_id to be either declared as a
compile-time constant by the cgroup_subsys.h include in cgroup.h, or, if it's
a module, initialized within the struct by cgroup_load_subsys.
Signed-off-by: Ben Blum bb...@andrew.cmu.edu
Acked-by: Li Zefan l...@cn.fujitsu.com
But can we reorder this patch
time) to once per attached
hierarchy (in parse_cgroupfs_options and rebind_subsystems) (i.e., 0 or 1).
It also adds a proper module_delete call in net/sched/cls_cgroup.c.
Signed-off-by: Ben Blum bb...@andrew.cmu.edu
Acked-by: Li Zefan l...@cn.fujitsu.com
Also please fix comment style
by the
list's mutex.
Signed-off-by: Dave Anderson ander...@redhat.com
Reviewed-by: Li Zefan l...@cn.fujitsu.com
___
Containers mailing list
contain...@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Kirill A. Shutemov wrote:
This patch introduces write-only file cgroup.event_control in every
cgroup.
To register new notification handler you need:
- create an eventfd;
- open a control file to be monitored. Callbacks register_event() and
unregister_event() must be defined for the
+/*
+ * Check if a file is a control file
+ */
+static inline struct cftype *__file_cft(struct file *file)
+{
+if (file-f_dentry-d_inode-i_fop != cgroup_file_operations)
+return ERR_PTR(-EINVAL);
I don't think this check is needed.
Sorry, please ignore this comment
@@ -1291,6 +1324,7 @@ static int cgroup_get_sb(struct file_system_type
*fs_type,
struct cgroupfs_root *new_root;
/* First find the desired set of subsystems */
+ down_read(subsys_mutex);
Hmm.. this can lead to deadlock. sget() returns success with sb-s_umount
held, so here we have:
How does this sound as a possible solution, in cgroup_get_sb:
1) Take subsys_mutex
2) Call parse_cgroupfs_options()
3) Drop subsys_mutex
4) Call sget(), which gets sb-s_umount without subsys_mutex held
5) Take subsys_mutex
6) Call verify_cgroupfs_options()
7) Proceed as normal
In which
Ben Blum wrote:
On Tue, Dec 08, 2009 at 02:11:21PM +0800, Li Zefan wrote:
This patch adds a mechanism with which a subsystem can specify dependencies
on
other subsystems. Since subsystems can come and go, it would not be useful
to
refer to a depended-upon subsystem by subsys_id, so instead
Fix To and Cc..
Li Zefan wrote:
Ben Blum wrote:
On Tue, Dec 08, 2009 at 03:38:43PM +0800, Li Zefan wrote:
@@ -1291,6 +1324,7 @@ static int cgroup_get_sb(struct file_system_type
*fs_type,
struct cgroupfs_root *new_root;
/* First find the desired set of subsystems */
+ down_read
Ben Blum wrote:
On Tue, Dec 08, 2009 at 03:38:43PM +0800, Li Zefan wrote:
@@ -1291,6 +1324,7 @@ static int cgroup_get_sb(struct file_system_type
*fs_type,
struct cgroupfs_root *new_root;
/* First find the desired set of subsystems */
+ down_read(subsys_mutex);
Hmm.. this can
+struct cgroup_subsys net_cls_subsys = {
+ .name = net_cls,
+ .create = cgrp_create,
+ .destroy= cgrp_destroy,
+ .populate = cgrp_populate,
+#ifdef CONFIG_NET_CLS_CGROUP
+ .subsys_id = net_cls_subsys_id,
+#else
+#define
This patch adds a mechanism with which a subsystem can specify dependencies on
other subsystems. Since subsystems can come and go, it would not be useful to
refer to a depended-upon subsystem by subsys_id, so instead a NULL-terminated
array of strings must be specified. Validation is done by
@@ -1291,6 +1324,7 @@ static int cgroup_get_sb(struct file_system_type
*fs_type,
struct cgroupfs_root *new_root;
/* First find the desired set of subsystems */
+ down_read(subsys_mutex);
Hmm.. this can lead to deadlock. sget() returns success with sb-s_umount
held, so
Hi Ben,
The current code (with or without your patch) may lead to an error
because the fork hook can fail and the exit hook is called in all the
cases making the fork / exit asymmetric.
The _current_ code won't lead to this error, because the fork hook
can't fail.
Right, as no
1 - 100 of 348 matches
Mail list logo