From: Ingo Oeser <netdev@axxeo.de>
Date: Thu, 20 Dec 2007 19:32:45 +0100
> static inline inet_twsk_put(struct inet_timewait_sock *tw)
> {
> kref_put(&tw->kref, inet_twsk_release);
> }
>
> David, can you see any reason (e.g. some crazy lock stuff) NOT to do this?
Look at how this datastructure actually works before making
such suggestions, don't just look at the context provided
purely by a patch.
"inet_timewait_sock" begins with a "struct sock_common"
which is where the atomic_t is, and:
#define tw_refcnt __tw_common.skc_refcnt
So you would have to change struct sock_common over to kref, and thus
the entire networking, in order to make such a change.
I see zero value in this. There are millions of more useful things to
invest that kind of time on.
But you would have seen this instantly if you had spent 5 seconds
looking at how these datastructures are defined. Instead you choose
to make me do it and explain it to you instead.