On Tue, Sep 01, 2015 at 01:14:20PM -0700, Eric Dumazet wrote: > > 2. Use a spinlock to protect the dst_cache operations > > Well, a seqlock would be better : No need for an atomic operation in > fast path. > seqlock can ensure consistency between idst->dst and idst->cookie. However, IPv6 dst destruction is not protected by rcu. dst_free() is directly called, like in ip6_fib.c and a few other places. Hence, atomic_inc_not_zero() cannot be used here because the dst may have already been kmem_cache_free() when refcnt is 0. A spinlock is needed to stop the ip6_tnl_dst_set() side from removing the refcnt. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
- [PATCH net 3/3] ipv6: Fix dst_entry refcnt bugs in ip6_tu... Martin KaFai Lau
- Re: [PATCH net 3/3] ipv6: Fix dst_entry refcnt bugs ... Eric Dumazet
- Re: [PATCH net 3/3] ipv6: Fix dst_entry refcnt b... Martin KaFai Lau
- Re: [PATCH net 3/3] ipv6: Fix dst_entry refc... Eric Dumazet
- Re: [PATCH net 3/3] ipv6: Fix dst_entry ... Martin KaFai Lau
- Re: [PATCH net 3/3] ipv6: Fix dst_e... Eric Dumazet
- Re: [PATCH net 3/3] ipv6: Fix d... Martin KaFai Lau
- Re: [PATCH net 3/3] ipv6: Fix d... Martin KaFai Lau
- Re: [PATCH net 3/3] ipv6: Fix d... Martin KaFai Lau
- Re: [PATCH net 3/3] ipv6: Fix dst_entry refcnt b... Martin KaFai Lau
- Re: [PATCH net 3/3] ipv6: Fix dst_entry refcnt b... Martin KaFai Lau
- Re: [PATCH net 3/3] ipv6: Fix dst_entry refc... Eric Dumazet
- Re: [PATCH net 3/3] ipv6: Fix dst_entry ... Martin KaFai Lau
- Re: [PATCH net 3/3] ipv6: Fix dst_e... Eric Dumazet
- Re: [PATCH net 3/3] ipv6: Fix d... David Miller
- Re: [PATCH net 3/3] ipv6: Fix d... Martin KaFai Lau
- Re: [PATCH net 3/3] ipv6: Fix d... David Miller
- Re: [PATCH net 3/3] ipv6: Fix d... Eric Dumazet
- [PATCH net 1/3] ipv6: Refactor common ip6gre_tunnel_init ... Martin KaFai Lau