Skip to content

Commit

Permalink
cgroup,rcu: convert call_rcu(__free_css_id_cb) to kfree_rcu()
Browse files Browse the repository at this point in the history
The rcu callback __free_css_id_cb() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(__free_css_id_cb).

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: Paul Menage <menage@google.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
  • Loading branch information
Lai Jiangshan authored and Paul E. McKenney committed May 8, 2011
1 parent f2da1c4 commit 025cea9
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -4610,14 +4610,6 @@ bool css_is_ancestor(struct cgroup_subsys_state *child,
return ret;
}

static void __free_css_id_cb(struct rcu_head *head)
{
struct css_id *id;

id = container_of(head, struct css_id, rcu_head);
kfree(id);
}

void free_css_id(struct cgroup_subsys *ss, struct cgroup_subsys_state *css)
{
struct css_id *id = css->id;
Expand All @@ -4632,7 +4624,7 @@ void free_css_id(struct cgroup_subsys *ss, struct cgroup_subsys_state *css)
spin_lock(&ss->id_lock);
idr_remove(&ss->idr, id->id);
spin_unlock(&ss->id_lock);
call_rcu(&id->rcu_head, __free_css_id_cb);
kfree_rcu(id, rcu_head);
}
EXPORT_SYMBOL_GPL(free_css_id);

Expand Down

0 comments on commit 025cea9

Please sign in to comment.