lkml.org 
[lkml]   [2011]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/4] cgroup: remove extra calls to find_existing_css_set
> @@ -2091,6 +2010,10 @@ int cgroup_attach_proc(struct cgroup *cgrp, struct task_struct *leader)
> * rcu or tasklist locked. instead, build an array of all threads in the
> * group - group_rwsem prevents new threads from appearing, and if
> * threads exit, this will just be an over-estimate.
> + *
> + * While creating the list, also make sure css_sets exist for all
> + * threads to be migrated. we use find_css_set, which allocates a new
> + * one if necessary.
> */
> group_size = get_nr_threads(leader);
> /* flex_array supports very large thread-groups better than kmalloc. */
> @@ -2137,6 +2060,12 @@ int cgroup_attach_proc(struct cgroup *cgrp, struct task_struct *leader)
> /* nothing to do if this task is already in the cgroup */
> if (ent.cgrp == cgrp)
> continue;
> + ent.cg = find_css_set(tsk->cgroups, cgrp);

unfortunately This won't work, because we are holding tasklist_lock.

> + if (!ent.cg) {
> + retval = -ENOMEM;
> + group_size = i;
> + goto out_list_teardown;
> + }
> retval = flex_array_put(group, i, &ent, GFP_ATOMIC);
> BUG_ON(retval != 0);
> i++;


\
 
 \ /
  Last update: 2011-12-22 06:51    [W:5.676 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site