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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011/3/15 Lai Jiangshan <laijs@xxxxxxxxxxxxxx>:
>
> 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 <laijs@xxxxxxxxxxxxxx>

Acked-by: Paul Menage <menage@xxxxxxxxxx>

> ---
>  kernel/cgroup.c |    9 +--------
>  1 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 *cgrp)
>        return ret;
>  }
>
> -static void free_cgroup_rcu(struct rcu_head *obj)
> -{
> -       struct cgroup *cgrp = container_of(obj, struct cgroup, rcu_head);
> -
> -       kfree(cgrp);
> -}
> -
>  static void cgroup_diput(struct dentry *dentry, struct inode *inode)
>  {
>        /* is dentry a directory ? if so, kfree() associated cgroup */
> @@ -850,7 +843,7 @@ static void cgroup_diput(struct dentry *dentry, struct inode *inode)
>                 */
>                BUG_ON(!list_empty(&cgrp->pidlists));
>
> -               call_rcu(&cgrp->rcu_head, free_cgroup_rcu);
> +               kfree_rcu(cgrp, rcu_head);
>        }
>        iput(inode);
>  }
> --
> 1.7.4
>
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers



[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux