cgroup: use a per-cgroup work for release agent
PATCH v2 1/1 cgroup: use a per-cgroup work for release agent
Instead of using a global work to schedule release agent on removable cgroups, we change to use a per-cgroup work to do this, which makes the code much simpler.
v2: use a dedicated work instead of reusing css->destroy_work. (Tejun)
Signed-off-by Zefan Li <[email protected]>
--- include/linux/cgroup.h | 10 ++--- kernel/cgroup.c | 108 +++++++++++++++---------------------------------- 2 files changed, 36 insertions(+), 82 deletions(-)
include/linux/cgroup.h +3 -7
@@ -235,13 +235,6 @@ struct cgroup {struct list_head e_csets[CGROUP_SUBSYS_COUNT ];/* -* Linked list running through all cgroups that can -* potentially be reaped by the release agent. Protected by -* release_list_lock -*/ -struct list_head release_list; - -/* * list of pidlists, up to two for each namespace (one for procs, one * for tasks); created on demand. */
@@ -250,6 +243,9 @@ struct cgroup {/* used to wait for offlining of csses */ wait_queue_head_t offline_waitq; + +/* used to schedule release agent */ +struct work_struct release_agent_work; };#define MAX_CGROUP_ROOT_NAMELEN 64
kernel/cgroup.c +33 -75
153 lines not on this page · raw message
Signature · 1 line
1.8.0.2
Quoted 7 lines · Zefan Li
Instead of using a global work to schedule release agent on removable cgroups, we change to use a per-cgroup work to do this, which makes the code much simpler.
v2: use a dedicated work instead of reusing
css->destroy_work. (Tejun)Signed-off-by Zefan Li <[email protected]>
Applied to cgroup/for-3.18.
Thanks.
Signature · 1 line
tejun