2011-03-15 20:04:00

by Paul Menage

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

2011/3/15 Lai Jiangshan <[email protected]>:
>
> The rcu callback free_cgroup_rcu() just calls a kfree(),
> so we use kfree_rcu() instead of the call_rcu(free_cgroup_rcu).
>
> Signed-off-by: Lai Jiangshan <[email protected]>

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

> ---
> =A0kernel/cgroup.c | =A0 =A09 +--------
> =A01 files changed, 1 insertions(+), 8 deletions(-)
>
> diff --git a/kernel/cgroup.c b/kernel/cgroup.c
> index ad485d4..5c83c91 100644
> --- a/kernel/cgroup.c
> +++ b/kernel/cgroup.c
> @@ -806,13 +806,6 @@ static int cgroup_call_pre_destroy(struct cgroup *cg=
rp)
> =A0 =A0 =A0 =A0return ret;
> =A0}
>
> -static void free_cgroup_rcu(struct rcu_head *obj)
> -{
> - =A0 =A0 =A0 struct cgroup *cgrp =3D container_of(obj, struct cgroup, rc=
u_head);
> -
> - =A0 =A0 =A0 kfree(cgrp);
> -}
> -
> =A0static void cgroup_diput(struct dentry *dentry, struct inode *inode)
> =A0{
> =A0 =A0 =A0 =A0/* is dentry a directory ? if so, kfree() associated cgrou=
p */
> @@ -850,7 +843,7 @@ static void cgroup_diput(struct dentry *dentry, struc=
t inode *inode)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 */
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0BUG_ON(!list_empty(&cgrp->pidlists));
>
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 call_rcu(&cgrp->rcu_head, free_cgroup_rcu);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 kfree_rcu(cgrp, rcu_head);
> =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0iput(inode);
> =A0}
> --
> 1.7.4
>