Re: [PATCH 1/2] rcu: add rcu_access_pointer and rcu_dereference_protect

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eric Dumazet
Date: Wednesday, April 7, 2010 - 9:35 am

Le mercredi 07 avril 2010 à 17:19 +0100, David Howells a écrit :


Because when sk->sk_filter is eventually written by some thread, this
thread _must_ own a reference on the socket, that is sk_wmem_alloc > 0

So when reading sk->sk_filter, the general condition is : 
- We own the rcu lock 
- But on the particular case of __sk_free(),
  we owned the very last reference to sk (we are going to kfree it), so
nobody can possibly change sk->sk_filter under us.



--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 1/2] rcu: add rcu_access_pointer and rcu_derefe ..., Eric Dumazet, (Wed Apr 7, 9:35 am)