2011-03-15 20:04:33

by Paul Menage

[permalink] [raw]
Subject: Re: [PATCH 03/17] cgroup, rcu: convert call_rcu(__free_css_id_cb) to kfree_rcu()

2011/3/15 Lai Jiangshan <[email protected]>:
>
>
> 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 <[email protected]>

Acked-by: Paul Menage <[email protected]>


> ---
> =A0kernel/cgroup.c | =A0 10 +---------
> =A01 files changed, 1 insertions(+), 9 deletions(-)
>
> diff --git a/kernel/cgroup.c b/kernel/cgroup.c
> index 5c83c91..b7d3f6d 100644
> --- a/kernel/cgroup.c
> +++ b/kernel/cgroup.c
> @@ -4612,14 +4612,6 @@ bool css_is_ancestor(struct cgroup_subsys_state *c=
hild,
> =A0 =A0 =A0 =A0return ret;
> =A0}
>
> -static void __free_css_id_cb(struct rcu_head *head)
> -{
> - =A0 =A0 =A0 struct css_id *id;
> -
> - =A0 =A0 =A0 id =3D container_of(head, struct css_id, rcu_head);
> - =A0 =A0 =A0 kfree(id);
> -}
> -
> =A0void free_css_id(struct cgroup_subsys *ss, struct cgroup_subsys_state =
*css)
> =A0{
> =A0 =A0 =A0 =A0struct css_id *id =3D css->id;
> @@ -4634,7 +4626,7 @@ void free_css_id(struct cgroup_subsys *ss, struct c=
group_subsys_state *css)
> =A0 =A0 =A0 =A0spin_lock(&ss->id_lock);
> =A0 =A0 =A0 =A0idr_remove(&ss->idr, id->id);
> =A0 =A0 =A0 =A0spin_unlock(&ss->id_lock);
> - =A0 =A0 =A0 call_rcu(&id->rcu_head, __free_css_id_cb);
> + =A0 =A0 =A0 kfree_rcu(id, rcu_head);
> =A0}
> =A0EXPORT_SYMBOL_GPL(free_css_id);
>
> --
> 1.7.4
>