[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130816164544.628ae1df@nehalam.linuxnetplumber.net>
Date: Fri, 16 Aug 2013 16:45:44 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Wei Yongjun <weiyj.lk@...il.com>
Cc: davem@...emloft.net, pshelar@...ira.com,
mike.rapoport@...ellosystems.com, amwang@...hat.com,
yongjun_wei@...ndmicro.com.cn, netdev@...r.kernel.org
Subject: Re: [PATCH -next] vxlan: using kfree_rcu() to simplify the code
On Sat, 17 Aug 2013 07:32:09 +0800
Wei Yongjun <weiyj.lk@...il.com> wrote:
> From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
>
> The callback function of call_rcu() just calls a kfree(), so we
> can use kfree_rcu() instead of call_rcu() + callback function.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
> ---
> drivers/net/vxlan.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
> index 227b54a..d6fc046 100644
> --- a/drivers/net/vxlan.c
> +++ b/drivers/net/vxlan.c
> @@ -498,12 +498,6 @@ static int vxlan_fdb_create(struct vxlan_dev *vxlan,
> return 0;
> }
>
> -static void vxlan_fdb_free_rdst(struct rcu_head *head)
> -{
> - struct vxlan_rdst *rd = container_of(head, struct vxlan_rdst, rcu);
> - kfree(rd);
> -}
> -
> static void vxlan_fdb_free(struct rcu_head *head)
> {
> struct vxlan_fdb *f = container_of(head, struct vxlan_fdb, rcu);
> @@ -643,7 +637,7 @@ static int vxlan_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],
> */
> if (rd && !list_is_singular(&f->remotes)) {
> list_del_rcu(&rd->list);
> - call_rcu(&rd->rcu, vxlan_fdb_free_rdst);
> + kfree_rcu(rd, rcu);
> goto out;
> }
>
>
Acked-by: Stephen Hemminger <stephen@...workplumber.org>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists