Re: [patch v1, kernel version 3.2.1] Source mode for macvlaninteraface

From: Eric Dumazet
Date: Mon Jan 23 2012 - 12:08:48 EST


Le lundi 23 janvier 2012 Ã 15:44 +0100, Åtefan Gula a Ãcrit :
> 2012/1/23 Eric Dumazet <eric.dumazet@xxxxxxxxx>:

> >> +static void macvlan_hash_del_sources(struct macvlan_source_list *list,
> >> + bool sync)
> >> +{
> >> + hlist_del_rcu(&list->hlist);
> >> + kfree_rcu(list, rcu);
> >> + if (sync)
> >> + synchronize_rcu();
> >> +}
> >> +
> >
> > Please explain why are you using synchronize_rcu() here, as there must
> > be a good reason, but I missed it.
> I though so, but I was not sure whether that should be removed or not
> so I rather leave it there as I followed the original code structure
> of macvlan driver. So should I remove it?

If you use kfree_rcu(), its a call_rcu() : A grace period will be
respected before the object freeing, so you dont need the
synchronize_rcu() at all.



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/