Subject: Re: What protects rcu_dereference() in __sk_free()?

From: Eric Dumazet <[email-masked]>
Date: Sat, 16 Jan 2010 09:55:34 +0100

Le 15/01/2010 20:51, Paul E. McKenney a écrit :
> 
> Thank you for the info, Eric!
> 
> One option would be to remove the rcu_dereference() from __sk_free().
> Given that it was there, my thought would be to make it read as follows:
> 
> 	filter = rcu_dereference_check(sk->sk_filter,
> 				       atomic_read(&sk->sk_wmem_alloc) == 0);
> 
> This approach would have the benefit of potentially catching some race
> conditions if built with CONFIG_PROVE_RCU.  Does this seem reasonable to
> you?

Thats a good suggestion, this documents the thing with no runtime cost.

Thanks